hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/drivers/power/supply/pda_power.c
....@@ -1,13 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Common power driver for PDAs and phones with one or two external
34 * power supplies (AC/USB) connected to main and backup batteries,
45 * and optional builtin charger.
56 *
67 * Copyright © 2007 Anton Vorontsov <cbou@mail.ru>
7
- *
8
- * This program is free software; you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License version 2 as
10
- * published by the Free Software Foundation.
118 */
129
1310 #include <linux/module.h>
....@@ -432,6 +429,10 @@
432429
433430 static int pda_power_remove(struct platform_device *pdev)
434431 {
432
+#if IS_ENABLED(CONFIG_USB_PHY)
433
+ if (!IS_ERR_OR_NULL(transceiver) && pdata->use_otg_notifier)
434
+ usb_unregister_notifier(transceiver, &otg_nb);
435
+#endif
435436 if (pdata->is_usb_online && usb_irq)
436437 free_irq(usb_irq->start, pda_psy_usb);
437438 if (pdata->is_ac_online && ac_irq)