Messages in this thread | | | Date | Tue, 24 Mar 2015 11:22:40 +0100 | Subject | Re: [PATCH] IIO: Adds ACPI support for ST gyroscopes | From | Linus Walleij <> |
| |
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
| |