All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] iio: proximity: sx9500: Use devm_gpiod_get()
@ 2017-06-10 19:08 Andy Shevchenko
  2017-06-11 10:33 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2017-06-10 19:08 UTC (permalink / raw)
  To: Jonathan Cameron, linux-iio, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler
  Cc: Andy Shevchenko

Since index is always 0 replace devm_gpiod_get_index() by devm_gpiod_get().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/iio/proximity/sx9500.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/iio/proximity/sx9500.c b/drivers/iio/proximity/sx9500.c
index 9ea147f1a50d..f42b3a1c75ff 100644
--- a/drivers/iio/proximity/sx9500.c
+++ b/drivers/iio/proximity/sx9500.c
@@ -878,8 +878,7 @@ static void sx9500_gpio_probe(struct i2c_client *client,
 
 	dev = &client->dev;
 
-	data->gpiod_rst = devm_gpiod_get_index(dev, SX9500_GPIO_RESET,
-					       0, GPIOD_OUT_HIGH);
+	data->gpiod_rst = devm_gpiod_get(dev, SX9500_GPIO_RESET, GPIOD_OUT_HIGH);
 	if (IS_ERR(data->gpiod_rst)) {
 		dev_warn(dev, "gpio get reset pin failed\n");
 		data->gpiod_rst = NULL;
-- 
2.11.0

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

* Re: [PATCH v1] iio: proximity: sx9500: Use devm_gpiod_get()
  2017-06-10 19:08 [PATCH v1] iio: proximity: sx9500: Use devm_gpiod_get() Andy Shevchenko
@ 2017-06-11 10:33 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2017-06-11 10:33 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: linux-iio, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, Julia Lawall

On Sat, 10 Jun 2017 22:08:21 +0300
Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:

> Since index is always 0 replace devm_gpiod_get_index() by devm_gpiod_get().
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Hi Andy,

Good little tidy up. Looks like a classic use for a coccinelle patch
if you have time to take it further.  Sort of thing that will sneak in
within future drivers so good to tidy up all cases automatically ;)

Applied to the togreg branch of iio.git and pushed out as testing
for the autobuilders to play with it.

Thanks,

Jonathan
> ---
>  drivers/iio/proximity/sx9500.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/proximity/sx9500.c b/drivers/iio/proximity/sx9500.c
> index 9ea147f1a50d..f42b3a1c75ff 100644
> --- a/drivers/iio/proximity/sx9500.c
> +++ b/drivers/iio/proximity/sx9500.c
> @@ -878,8 +878,7 @@ static void sx9500_gpio_probe(struct i2c_client *client,
>  
>  	dev = &client->dev;
>  
> -	data->gpiod_rst = devm_gpiod_get_index(dev, SX9500_GPIO_RESET,
> -					       0, GPIOD_OUT_HIGH);
> +	data->gpiod_rst = devm_gpiod_get(dev, SX9500_GPIO_RESET, GPIOD_OUT_HIGH);
>  	if (IS_ERR(data->gpiod_rst)) {
>  		dev_warn(dev, "gpio get reset pin failed\n");
>  		data->gpiod_rst = NULL;


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

end of thread, other threads:[~2017-06-11 10:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-10 19:08 [PATCH v1] iio: proximity: sx9500: Use devm_gpiod_get() Andy Shevchenko
2017-06-11 10:33 ` Jonathan Cameron

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.