hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/drivers/power/reset/gpio-restart.c
....@@ -1,16 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Toggles a GPIO pin to restart a device
34 *
45 * Copyright (C) 2014 Google, Inc.
5
- *
6
- * This software is licensed under the terms of the GNU General Public
7
- * License version 2, as published by the Free Software Foundation, and
8
- * may be copied, distributed, and modified under those terms.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
146 *
157 * Based on the gpio-poweroff driver.
168 */
....@@ -72,9 +64,11 @@
7264
7365 gpio_restart->reset_gpio = devm_gpiod_get(&pdev->dev, NULL,
7466 open_source ? GPIOD_IN : GPIOD_OUT_LOW);
75
- if (IS_ERR(gpio_restart->reset_gpio)) {
76
- dev_err(&pdev->dev, "Could net get reset GPIO\n");
77
- return PTR_ERR(gpio_restart->reset_gpio);
67
+ ret = PTR_ERR_OR_ZERO(gpio_restart->reset_gpio);
68
+ if (ret) {
69
+ if (ret != -EPROBE_DEFER)
70
+ dev_err(&pdev->dev, "Could not get reset GPIO\n");
71
+ return ret;
7872 }
7973
8074 gpio_restart->restart_handler.notifier_call = gpio_restart_notify;