]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
power: supply: pda_power: add missed usb_unregister_notifier
authorChuhong Yuan <hslester96@gmail.com>
Fri, 15 Nov 2019 06:25:15 +0000 (14:25 +0800)
committerSebastian Reichel <sre@kernel.org>
Thu, 19 Dec 2019 00:07:53 +0000 (01:07 +0100)
The driver forgets to unregister the notifier in remove.
Add the call to fix it.

Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/pda_power.c

index 3ae5707d39fa4371d7f5066d6bc7b554789ec960..03a37fd6be274433e2e3229aa0fb4fc59c976f92 100644 (file)
@@ -429,6 +429,10 @@ static int pda_power_probe(struct platform_device *pdev)
 
 static int pda_power_remove(struct platform_device *pdev)
 {
+#if IS_ENABLED(CONFIG_USB_PHY)
+       if (!IS_ERR_OR_NULL(transceiver) && pdata->use_otg_notifier)
+               usb_unregister_notifier(transceiver, &otg_nb);
+#endif
        if (pdata->is_usb_online && usb_irq)
                free_irq(usb_irq->start, pda_psy_usb);
        if (pdata->is_ac_online && ac_irq)