lkml.org 
[lkml]   [2015]   [Mar]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] IIO: Adds ACPI support for ST gyroscopes
From
On Mon, Mar 23, 2015 at 2:40 PM, Robert Dolca <robert.dolca@intel.com> wrote:

> Signed-off-by: Robert Dolca <robert.dolca@intel.com>

That's a very terse commit message.

> + /* Get IRQ GPIO */
> + gpiod_irq = devm_gpiod_get_index(&client->dev, 0, 0);
> + if (IS_ERR(gpiod_irq))
> + return -ENODEV;
> +
> + /* Configure IRQ GPIO */
> + ret = gpiod_direction_input(gpiod_irq);
> + if (ret)
> + return ret;


Why issue two calls when one is enough. And don't discard
the nice return code. Do this instead:

gpiod_irq = devm_gpiod_get_index(&client->dev, 0, 0, GPIOD_IN);
if (IS_ERR(gpiod_irq))
return PTR_ERR(gpiod_irq);

Yours,
Linus Walleij


\
 
 \ /
  Last update: 2015-03-24 11:41    [W:0.134 / U:0.496 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site