Commit a2e63709 authored by Arvind Yadav's avatar Arvind Yadav Committed by Greg Kroah-Hartman

staging: greybus: Use gpio_is_valid()

Replace the manual validity checks for the GPIO with the
gpio_is_valid().
Signed-off-by: default avatarArvind Yadav <arvind.yadav.cs@gmail.com>
Reviewed-by: default avatarAlex Elder <elder@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3ea74d38
...@@ -447,7 +447,7 @@ static int arche_platform_probe(struct platform_device *pdev) ...@@ -447,7 +447,7 @@ static int arche_platform_probe(struct platform_device *pdev)
arche_pdata->svc_reset_gpio = of_get_named_gpio(np, arche_pdata->svc_reset_gpio = of_get_named_gpio(np,
"svc,reset-gpio", "svc,reset-gpio",
0); 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"); dev_err(dev, "failed to get reset-gpio\n");
return arche_pdata->svc_reset_gpio; return arche_pdata->svc_reset_gpio;
} }
...@@ -467,7 +467,7 @@ static int arche_platform_probe(struct platform_device *pdev) ...@@ -467,7 +467,7 @@ static int arche_platform_probe(struct platform_device *pdev)
arche_pdata->svc_sysboot_gpio = of_get_named_gpio(np, arche_pdata->svc_sysboot_gpio = of_get_named_gpio(np,
"svc,sysboot-gpio", "svc,sysboot-gpio",
0); 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"); dev_err(dev, "failed to get sysboot gpio\n");
return arche_pdata->svc_sysboot_gpio; return arche_pdata->svc_sysboot_gpio;
} }
...@@ -486,7 +486,7 @@ static int arche_platform_probe(struct platform_device *pdev) ...@@ -486,7 +486,7 @@ static int arche_platform_probe(struct platform_device *pdev)
arche_pdata->svc_refclk_req = of_get_named_gpio(np, arche_pdata->svc_refclk_req = of_get_named_gpio(np,
"svc,refclk-req-gpio", "svc,refclk-req-gpio",
0); 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"); dev_err(dev, "failed to get svc clock-req gpio\n");
return arche_pdata->svc_refclk_req; return arche_pdata->svc_refclk_req;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment