Skip to contentSkip to conversation

power: supply: pda_power: add missed usb_unregister_notifier

PATCH In review Chuhong Yuan 2 participants 2 messages Nov 15, 2019 – Dec 19, 2019 Power supply

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 power: supply: pda_power: add missed usb_unregister_notifier

The driver forgets to unregister the notifier in remove. Add the call to fix it.

---
 drivers/power/supply/pda_power.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/power/supply/pda_power.c +4 -0
index 3ae5707d39fa..03a37fd6be27 100644
@@ -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)
Signature · 1 line
2.24.0
#1 lore raw

Hi,

Quoted 5 lines · Chuhong Yuan

The driver forgets to unregister the notifier in remove. Add the call to fix it.

---

Thanks, queued to power-supply's for-next branch.

-- Sebastian

Quoted 21 lines
 drivers/power/supply/pda_power.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/power/supply/pda_power.c +4 -0
index 3ae5707d39fa..03a37fd6be27 100644
@@ -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)
Signature · 1 line
2.24.0