All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] staging: greybus: Use gpio_is_valid()
@ 2018-04-28  4:35 Arvind Yadav
  2018-04-28 19:58 ` [greybus-dev] " Alex Elder
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Arvind Yadav @ 2018-04-28  4:35 UTC (permalink / raw)
  To: hvaibhav.linux, johan, elder, gregkh; +Cc: devel, greybus-dev, linux-kernel

Replace the manual validity checks for the GPIO with the
gpio_is_valid().

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Reviewed-by: Alex Elder <elder@linaro.org>
---
chnage in v2 :
             Returning invalid gpio as error instead of -ENODEV.

 drivers/staging/greybus/arche-platform.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/greybus/arche-platform.c b/drivers/staging/greybus/arche-platform.c
index 83254a7..c3a7da5 100644
--- a/drivers/staging/greybus/arche-platform.c
+++ b/drivers/staging/greybus/arche-platform.c
@@ -448,7 +448,7 @@ static int arche_platform_probe(struct platform_device *pdev)
 	arche_pdata->svc_reset_gpio = of_get_named_gpio(np,
 							"svc,reset-gpio",
 							0);
-	if (arche_pdata->svc_reset_gpio < 0) {
+	if (!gpio_is_valid(arche_pdata->svc_reset_gpio)) {
 		dev_err(dev, "failed to get reset-gpio\n");
 		return arche_pdata->svc_reset_gpio;
 	}
@@ -468,7 +468,7 @@ static int arche_platform_probe(struct platform_device *pdev)
 	arche_pdata->svc_sysboot_gpio = of_get_named_gpio(np,
 							  "svc,sysboot-gpio",
 							  0);
-	if (arche_pdata->svc_sysboot_gpio < 0) {
+	if (!gpio_is_valid(arche_pdata->svc_sysboot_gpio)) {
 		dev_err(dev, "failed to get sysboot gpio\n");
 		return arche_pdata->svc_sysboot_gpio;
 	}
@@ -487,7 +487,7 @@ static int arche_platform_probe(struct platform_device *pdev)
 	arche_pdata->svc_refclk_req = of_get_named_gpio(np,
 							"svc,refclk-req-gpio",
 							0);
-	if (arche_pdata->svc_refclk_req < 0) {
+	if (!gpio_is_valid(arche_pdata->svc_refclk_req)) {
 		dev_err(dev, "failed to get svc clock-req gpio\n");
 		return arche_pdata->svc_refclk_req;
 	}
-- 
2.7.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

end of thread, other threads:[~2018-05-02 10:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-28  4:35 [PATCH v2] staging: greybus: Use gpio_is_valid() Arvind Yadav
2018-04-28 19:58 ` [greybus-dev] " Alex Elder
2018-05-02  5:44 ` Viresh Kumar
2018-05-02  8:43 ` Johan Hovold
2018-05-02  9:45   ` Arvind Yadav
2018-05-02  9:57     ` Johan Hovold
2018-05-02 10:50       ` Arvind Yadav

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.