Re: [PATCH] IIO: Adds ACPI support for ST gyroscopes

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

 



On Mon, Mar 23, 2015 at 2:40 PM, Robert Dolca <robert.dolca@xxxxxxxxx> wrote:

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

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
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux