mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@ti.com>
To: Mathias Krause <minipli@googlemail.com>
Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>,
	David Woodhouse <dwmw2@infradead.org>,
	<linux-kernel@vger.kernel.org>, PaX Team <pageexec@freemail.hu>,
	Felipe Balbi <balbi@ti.com>, Anton Vorontsov <anton@enomsg.org>
Subject: Re: [PATCH 2/2] pda_power: Unregister USB notifier in pda_power_remove()
Date: Mon, 14 Apr 2014 16:35:04 -0500	[thread overview]
Message-ID: <20140414213504.GB22607@saruman.home> (raw)
In-Reply-To: <1396186455-3276-3-git-send-email-minipli@googlemail.com>

[-- Attachment #1: Type: text/plain, Size: 1150 bytes --]

On Sun, Mar 30, 2014 at 03:34:15PM +0200, Mathias Krause wrote:
> If we've registered a notifier in pda_power_probe() we must deregister
> it in pda_power_remove() to not let it work on stale data like, e.g.,
> the charger timer.
> 
> Cc: Felipe Balbi <balbi@ti.com>
> Cc: Anton Vorontsov <anton@enomsg.org>
> Signed-off-by: Mathias Krause <minipli@googlemail.com>
> ---
>  drivers/power/pda_power.c |    5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/power/pda_power.c b/drivers/power/pda_power.c
> index 87a963d0a8..aba23d6848 100644
> --- a/drivers/power/pda_power.c
> +++ b/drivers/power/pda_power.c
> @@ -430,6 +430,11 @@ static int pda_power_remove(struct platform_device *pdev)
>  	if (pdata->is_ac_online && ac_irq)
>  		free_irq(ac_irq->start, &pda_psy_ac);
>  
> +#if IS_ENABLED(CONFIG_USB_PHY)
> +	if (!IS_ERR_OR_NULL(transceiver) && pdata->use_otg_notifier)

IS_ERR() should be enough here.

> +		usb_unregister_notifier(transceiver, &otg_nb);
> +#endif
> +
>  	if (polling)
>  		del_timer_sync(&polling_timer);
>  	del_timer_sync(&charger_timer);
> -- 
> 1.7.10.4
> 

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2014-04-14 21:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-30 13:34 [PATCH 0/2] pda_power: USB notifier fixes Mathias Krause
2014-03-30 13:34 ` [PATCH 1/2] pda_power: Statically initialize notifier block Mathias Krause
2014-03-30 13:34 ` [PATCH 2/2] pda_power: Unregister USB notifier in pda_power_remove() Mathias Krause
2014-04-14 21:35   ` Felipe Balbi [this message]
2014-04-14 22:07     ` Mathias Krause
2014-04-14 22:08       ` Felipe Balbi
2014-04-14 22:11         ` Mathias Krause
2014-04-14 19:51 ` [PATCH 0/2] pda_power: USB notifier fixes Mathias Krause

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140414213504.GB22607@saruman.home \
    --to=balbi@ti.com \
    --cc=anton@enomsg.org \
    --cc=dbaryshkov@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=minipli@googlemail.com \
    --cc=pageexec@freemail.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®