linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mathias Krause <minipli@googlemail.com>
To: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>,
	David Woodhouse <dwmw2@infradead.org>
Cc: linux-kernel@vger.kernel.org,
	Mathias Krause <minipli@googlemail.com>,
	PaX Team <pageexec@freemail.hu>, Felipe Balbi <balbi@ti.com>,
	Anton Vorontsov <anton@enomsg.org>
Subject: [PATCH 2/2] pda_power: Unregister USB notifier in pda_power_remove()
Date: Sun, 30 Mar 2014 15:34:15 +0200	[thread overview]
Message-ID: <1396186455-3276-3-git-send-email-minipli@googlemail.com> (raw)
In-Reply-To: <1396186455-3276-1-git-send-email-minipli@googlemail.com>

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)
+		usb_unregister_notifier(transceiver, &otg_nb);
+#endif
+
 	if (polling)
 		del_timer_sync(&polling_timer);
 	del_timer_sync(&charger_timer);
-- 
1.7.10.4


  parent reply	other threads:[~2014-03-30 13:34 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 ` Mathias Krause [this message]
2014-04-14 21:35   ` [PATCH 2/2] pda_power: Unregister USB notifier in pda_power_remove() Felipe Balbi
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=1396186455-3276-3-git-send-email-minipli@googlemail.com \
    --to=minipli@googlemail.com \
    --cc=anton@enomsg.org \
    --cc=balbi@ti.com \
    --cc=dbaryshkov@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).