All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH resend v1 1/7] pps: clients: gpio: Bail out on error when requesting GPIO echo line
@ 2021-03-09 11:23 Andy Shevchenko
  2021-03-09 11:23 ` [PATCH resend v1 2/7] pps: clients: gpio: Use dev_err_probe() to avoid log noise Andy Shevchenko
                   ` (7 more replies)
  0 siblings, 8 replies; 15+ messages in thread
From: Andy Shevchenko @ 2021-03-09 11:23 UTC (permalink / raw)
  To: Andy Shevchenko, linux-kernel
  Cc: Rodolfo Giometti, Ryan Govostes, Greg Kroah-Hartman

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>
---
 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.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2021-03-15 12:35 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-09 11:23 [PATCH resend v1 1/7] pps: clients: gpio: Bail out on error when requesting GPIO echo line Andy Shevchenko
2021-03-09 11:23 ` [PATCH resend v1 2/7] pps: clients: gpio: Use dev_err_probe() to avoid log noise Andy Shevchenko
2021-03-09 12:25   ` Rodolfo Giometti
2021-03-09 11:23 ` [PATCH resend v1 3/7] pps: clients: gpio: Remove redundant condition in ->remove() Andy Shevchenko
2021-03-09 12:25   ` Rodolfo Giometti
2021-03-09 11:24 ` [PATCH resend v1 4/7] pps: clients: gpio: Get rid of legacy platform data Andy Shevchenko
2021-03-09 12:25   ` Rodolfo Giometti
2021-03-09 11:24 ` [PATCH resend v1 5/7] pps: clients: gpio: Make use of device properties Andy Shevchenko
2021-03-09 12:27   ` Rodolfo Giometti
2021-03-09 11:24 ` [PATCH resend v1 6/7] pps: clients: gpio: Use struct device pointer directly Andy Shevchenko
2021-03-09 12:30   ` Rodolfo Giometti
2021-03-09 11:24 ` [PATCH resend v1 7/7] pps: clients: gpio: Rearrange optional stuff in pps_gpio_setup() Andy Shevchenko
2021-03-09 12:30   ` Rodolfo Giometti
2021-03-09 12:23 ` [PATCH resend v1 1/7] pps: clients: gpio: Bail out on error when requesting GPIO echo line Rodolfo Giometti
2021-03-15 12:34 ` Andy Shevchenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.