lkml.org 
[lkml]   [2021]   [Mar]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 1/7] pps: clients: gpio: Bail out on error when requesting GPIO echo line
Date
When requesting optional GPIO echo line, bail out on error,
so user will know that something wrong with the existing property.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Rodolfo Giometti <giometti@enneenne.com>
---
drivers/pps/clients/pps-gpio.c | 10 +++++-----
1 file 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);
--
2.30.2
\
 
 \ /
  Last update: 2021-03-18 14:05    [W:0.097 / U:0.732 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site