Skip to contentSkip to conversation

input: touchscreen: silead: Use devm_gpiod_get

PATCH New Hans de Goede 2 participants 2 messages Aug 16, 2016 – Aug 22, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 input: touchscreen: silead: Use devm_gpiod_get

The silead code is using devm_foo for everything (and does not free any resources). Except that it is using gpiod_get instead of devm_gpiod_get (but is not freeing the gpio_desc), change this to use devm_gpiod_get so that the gpio will be properly released.

---
 drivers/input/touchscreen/silead.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/touchscreen/silead.c +1 -1
index 04992c5..3b80f14 100644
@@ -497,7 +497,7 @@ static int silead_ts_probe(struct i2c_client *client,
 	}
 
 	/* Power GPIO pin */
-	data->gpio_power = gpiod_get_optional(dev, "power", GPIOD_OUT_LOW);
+	data->gpio_power = devm_gpiod_get_optional(dev, "power", GPIOD_OUT_LOW);
 	if (IS_ERR(data->gpio_power)) {
 		if (PTR_ERR(data->gpio_power) != -EPROBE_DEFER)
 			dev_err(dev, "Shutdown GPIO request failed\n");
Signature · 1 line
2.7.4
maintainer Applied
#1 lore raw

PATCH 1/1 input: touchscreen: silead: Use devm_gpiod_get

Quoted 6 lines · Hans de Goede

The silead code is using devm_foo for everything (and does not free any resources). Except that it is using gpiod_get instead of devm_gpiod_get (but is not freeing the gpio_desc), change this to use devm_gpiod_get so that the gpio will be properly released.

Applied, thank you.

Quoted 20 lines
---
 drivers/input/touchscreen/silead.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/touchscreen/silead.c +1 -1
index 04992c5..3b80f14 100644
@@ -497,7 +497,7 @@ static int silead_ts_probe(struct i2c_client *client,
 	}
 
 	/* Power GPIO pin */
-	data->gpio_power = gpiod_get_optional(dev, "power", GPIOD_OUT_LOW);
+	data->gpio_power = devm_gpiod_get_optional(dev, "power", GPIOD_OUT_LOW);
 	if (IS_ERR(data->gpio_power)) {
 		if (PTR_ERR(data->gpio_power) != -EPROBE_DEFER)
 			dev_err(dev, "Shutdown GPIO request failed\n");
Signature · 1 line
2.7.4
Signature · 1 line
Dmitry