[PATCH 2/2] GPIO: Remove unneeded "gpio_is_valid" calls

Alexander Shiyan shc_work at mail.ru
Fri May 10 03:27:14 EDT 2013


Signed-off-by: Alexander Shiyan <shc_work at mail.ru>
---
 drivers/mci/atmel_mci.c      | 3 +--
 drivers/w1/masters/w1-gpio.c | 6 ++----
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/mci/atmel_mci.c b/drivers/mci/atmel_mci.c
index c5fd306..9570d36 100644
--- a/drivers/mci/atmel_mci.c
+++ b/drivers/mci/atmel_mci.c
@@ -608,8 +608,7 @@ static int atmci_probe(struct device_d *hw_dev)
 	return 0;
 
 err_gpio_cd_request:
-	if (gpio_is_valid(pd->detect_pin))
-		gpio_free(pd->detect_pin);
+	gpio_free(pd->detect_pin);
 
 	return ret;
 }
diff --git a/drivers/w1/masters/w1-gpio.c b/drivers/w1/masters/w1-gpio.c
index 946e9d3..6e017c6 100644
--- a/drivers/w1/masters/w1-gpio.c
+++ b/drivers/w1/masters/w1-gpio.c
@@ -88,14 +88,12 @@ static int __init w1_gpio_probe(struct device_d *dev)
 	if (pdata->enable_external_pullup)
 		pdata->enable_external_pullup(1);
 
-	if (gpio_is_valid(pdata->ext_pullup_enable_pin))
-		gpio_set_value(pdata->ext_pullup_enable_pin, 1);
+	gpio_set_value(pdata->ext_pullup_enable_pin, 1);
 
 	return 0;
 
  free_gpio_ext_pu:
-	if (gpio_is_valid(pdata->ext_pullup_enable_pin))
-		gpio_free(pdata->ext_pullup_enable_pin);
+	gpio_free(pdata->ext_pullup_enable_pin);
  free_gpio:
 	gpio_free(pdata->pin);
  free_master:
-- 
1.8.1.5




More information about the barebox mailing list