From: Chuhong Yuan Date: Fri, 15 Nov 2019 06:25:15 +0000 (+0800) Subject: power: supply: pda_power: add missed usb_unregister_notifier X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=dd04defd11b78a73b302587575bbcda1019925d8;p=linux.git power: supply: pda_power: add missed usb_unregister_notifier The driver forgets to unregister the notifier in remove. Add the call to fix it. Signed-off-by: Chuhong Yuan Signed-off-by: Sebastian Reichel --- diff --git a/drivers/power/supply/pda_power.c b/drivers/power/supply/pda_power.c index 3ae5707d39fa4..03a37fd6be274 100644 --- a/drivers/power/supply/pda_power.c +++ b/drivers/power/supply/pda_power.c @@ -429,6 +429,10 @@ wrongid: 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)