forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f9004dbfff8a3fbbd7e2a88c8a4327c7f2f8e5b2
kernel/drivers/extcon/extcon-palmas.c
....@@ -1,23 +1,12 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Palmas USB transceiver driver
34 *
4
- * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com
5
- * This program is free software; you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License as published by
7
- * the Free Software Foundation; either version 2 of the License, or
8
- * (at your option) any later version.
9
- *
5
+ * Copyright (C) 2013 Texas Instruments Incorporated - https://www.ti.com
106 * Author: Graeme Gregory <gg@slimlogic.co.uk>
117 * Author: Kishon Vijay Abraham I <kishon@ti.com>
12
- *
138 * Based on twl6030_usb.c
14
- *
159 * Author: Hema HK <hemahk@ti.com>
16
- *
17
- * This program is distributed in the hope that it will be useful,
18
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
19
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
- * GNU General Public License for more details.
2110 */
2211
2312 #include <linux/module.h>
....@@ -216,17 +205,15 @@
216205
217206 palmas_usb->id_gpiod = devm_gpiod_get_optional(&pdev->dev, "id",
218207 GPIOD_IN);
219
- if (IS_ERR(palmas_usb->id_gpiod)) {
220
- dev_err(&pdev->dev, "failed to get id gpio\n");
221
- return PTR_ERR(palmas_usb->id_gpiod);
222
- }
208
+ if (IS_ERR(palmas_usb->id_gpiod))
209
+ return dev_err_probe(&pdev->dev, PTR_ERR(palmas_usb->id_gpiod),
210
+ "failed to get id gpio\n");
223211
224212 palmas_usb->vbus_gpiod = devm_gpiod_get_optional(&pdev->dev, "vbus",
225213 GPIOD_IN);
226
- if (IS_ERR(palmas_usb->vbus_gpiod)) {
227
- dev_err(&pdev->dev, "failed to get vbus gpio\n");
228
- return PTR_ERR(palmas_usb->vbus_gpiod);
229
- }
214
+ if (IS_ERR(palmas_usb->vbus_gpiod))
215
+ return dev_err_probe(&pdev->dev, PTR_ERR(palmas_usb->vbus_gpiod),
216
+ "failed to get id gpio\n");
230217
231218 if (palmas_usb->enable_id_detection && palmas_usb->id_gpiod) {
232219 palmas_usb->enable_id_detection = false;