summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2021-03-18 14:03:15 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-03-24 08:26:31 +0100
commita4780db3ad13b5381e0512b4507857390efea963 (patch)
tree72a0d6be1ad98cc93ba07034ec514c0e196fc384 /drivers
parentbinder: BINDER_GET_FROZEN_INFO ioctl (diff)
downloadlinux-a4780db3ad13b5381e0512b4507857390efea963.tar.xz
linux-a4780db3ad13b5381e0512b4507857390efea963.zip
pps: clients: gpio: Bail out on error when requesting GPIO echo line
When requesting optional GPIO echo line, bail out on error, so user will know that something wrong with the existing property. Acked-by: Rodolfo Giometti <giometti@enneenne.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20210318130321.24227-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/pps/clients/pps-gpio.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/pps/clients/pps-gpio.c b/drivers/pps/clients/pps-gpio.c
index e0de1df2ede0..f89c31aa66f1 100644
--- a/drivers/pps/clients/pps-gpio.c
+++ b/drivers/pps/clients/pps-gpio.c
@@ -119,12 +119,12 @@ static int pps_gpio_setup(struct platform_device *pdev)
data->echo_pin = devm_gpiod_get_optional(&pdev->dev,
"echo",
GPIOD_OUT_LOW);
- if (data->echo_pin) {
- if (IS_ERR(data->echo_pin)) {
- dev_err(&pdev->dev, "failed to request ECHO GPIO\n");
- return PTR_ERR(data->echo_pin);
- }
+ if (IS_ERR(data->echo_pin)) {
+ dev_err(&pdev->dev, "failed to request ECHO GPIO\n");
+ return PTR_ERR(data->echo_pin);
+ }
+ if (data->echo_pin) {
ret = of_property_read_u32(np,
"echo-active-ms",
&value);