| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Common power driver for PDAs and phones with one or two external |
|---|
| 3 | 4 | * power supplies (AC/USB) connected to main and backup batteries, |
|---|
| 4 | 5 | * and optional builtin charger. |
|---|
| 5 | 6 | * |
|---|
| 6 | 7 | * 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. |
|---|
| 11 | 8 | */ |
|---|
| 12 | 9 | |
|---|
| 13 | 10 | #include <linux/module.h> |
|---|
| .. | .. |
|---|
| 432 | 429 | |
|---|
| 433 | 430 | static int pda_power_remove(struct platform_device *pdev) |
|---|
| 434 | 431 | { |
|---|
| 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 |
|---|
| 435 | 436 | if (pdata->is_usb_online && usb_irq) |
|---|
| 436 | 437 | free_irq(usb_irq->start, pda_psy_usb); |
|---|
| 437 | 438 | if (pdata->is_ac_online && ac_irq) |
|---|