* [PATCH] input: touchscreen: silead: Use devm_gpiod_get
@ 2016-08-16 21:47 Hans de Goede
[not found] ` <1471384043-11717-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Hans de Goede @ 2016-08-16 21:47 UTC (permalink / raw)
To: Dmitry Torokhov, Rob Herring, Chen-Yu Tsai
Cc: Maxime Ripard, linux-input-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, devicetree,
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.
Signed-off-by: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
drivers/input/touchscreen/silead.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/input/touchscreen/silead.c b/drivers/input/touchscreen/silead.c
index 04992c5..3b80f14 100644
--- a/drivers/input/touchscreen/silead.c
+++ b/drivers/input/touchscreen/silead.c
@@ -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");
--
2.7.4
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] input: touchscreen: silead: Use devm_gpiod_get
[not found] ` <1471384043-11717-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2016-08-22 21:12 ` Dmitry Torokhov
0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2016-08-22 21:12 UTC (permalink / raw)
To: Hans de Goede
Cc: Rob Herring, Chen-Yu Tsai, Maxime Ripard,
linux-input-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, devicetree
On Tue, Aug 16, 2016 at 11:47:23PM +0200, Hans de Goede wrote:
> 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.
>
> Signed-off-by: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Applied, thank you.
> ---
> drivers/input/touchscreen/silead.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/input/touchscreen/silead.c b/drivers/input/touchscreen/silead.c
> index 04992c5..3b80f14 100644
> --- a/drivers/input/touchscreen/silead.c
> +++ b/drivers/input/touchscreen/silead.c
> @@ -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");
> --
> 2.7.4
>
--
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-08-22 21:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-16 21:47 [PATCH] input: touchscreen: silead: Use devm_gpiod_get Hans de Goede
[not found] ` <1471384043-11717-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-08-22 21:12 ` Dmitry Torokhov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).