| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Toggles a GPIO pin to restart a device |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * 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. |
|---|
| 14 | 6 | * |
|---|
| 15 | 7 | * Based on the gpio-poweroff driver. |
|---|
| 16 | 8 | */ |
|---|
| .. | .. |
|---|
| 72 | 64 | |
|---|
| 73 | 65 | gpio_restart->reset_gpio = devm_gpiod_get(&pdev->dev, NULL, |
|---|
| 74 | 66 | 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; |
|---|
| 78 | 72 | } |
|---|
| 79 | 73 | |
|---|
| 80 | 74 | gpio_restart->restart_handler.notifier_call = gpio_restart_notify; |
|---|