RE: [PATCH gpio-for-next 03/10] iio: light: stk3310: use flags argument of devm_gpiod_get

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Uwe Kleine-König [mailto:u.kleine-koenig@xxxxxxxxxxxxxx]
> Sent: Monday, July 6, 2015 12:10 PM
> To: Linus Walleij; Alexandre Courbot
> Cc: linux-gpio@xxxxxxxxxxxxxxx; kernel@xxxxxxxxxxxxxx; Breana, Tiberiu A;
> Jonathan Cameron; Hartmut Knaack; Lars-Peter Clausen; Peter Meerwald;
> linux-iio@xxxxxxxxxxxxxxx
> Subject: [PATCH gpio-for-next 03/10] iio: light: stk3310: use flags argument of
> devm_gpiod_get
> 
> Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions)
> which appeared in v3.17-rc1, the gpiod_get* functions take an additional
> parameter that allows to specify direction and initial value for output.
> 
> Simplify driver accordingly. Furthermore this is one caller less that stops us
> making the flags argument to gpiod_get*() mandatory.
> 
> Acked-by: Jonathan Cameron <jic23@xxxxxxxxxx>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>

+1

Reviewed-by: Tiberiu Breana <tiberiu.a.breana@xxxxxxxxx>

> ---
>  drivers/iio/light/stk3310.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/drivers/iio/light/stk3310.c b/drivers/iio/light/stk3310.c index
> fee4297d7c8f..84c77d42a2c6 100644
> --- a/drivers/iio/light/stk3310.c
> +++ b/drivers/iio/light/stk3310.c
> @@ -488,16 +488,12 @@ static int stk3310_gpio_probe(struct i2c_client
> *client)
>  	dev = &client->dev;
> 
>  	/* gpio interrupt pin */
> -	gpio = devm_gpiod_get_index(dev, STK3310_GPIO, 0);
> +	gpio = devm_gpiod_get_index(dev, STK3310_GPIO, 0, GPIOD_IN);
>  	if (IS_ERR(gpio)) {
>  		dev_err(dev, "acpi gpio get index failed\n");
>  		return PTR_ERR(gpio);
>  	}
> 
> -	ret = gpiod_direction_input(gpio);
> -	if (ret)
> -		return ret;
> -
>  	ret = gpiod_to_irq(gpio);
>  	dev_dbg(dev, "GPIO resource, no:%d irq:%d\n", desc_to_gpio(gpio),
> ret);
> 
> --
> 2.1.4

��.n��������+%������w��{.n�����{��
b���ܨ}���Ơz�j:+v�����w����ޙ��&�)ߡ�a����z�ޗ���ݢj��w�f




[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux