Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1409206

Re: [PATCH 2/3] gpio: max77620: Implement gpio_get_direction callback

From Linus Walleij <linus.walleij@linaro.org>
Newsgroups linux.kernel
Subject Re: [PATCH 2/3] gpio: max77620: Implement gpio_get_direction callback
Date 2016-05-30 17:10 +0200
Message-ID <rEwZk-5PN-35@gated-at.bofh.it> (permalink)
References <rCkzg-3M3-31@gated-at.bofh.it> <rCkzg-3M3-35@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, May 24, 2016 at 3:13 PM, Laxman Dewangan <ldewangan@nvidia.com> wrote:

> Implement gpio_get_direction() callback for MAX77620 GPIO.
> This is useful for debugfs and the userspace ABI.
>
> Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>

>  #include <linux/gpio/driver.h>
> +#include <linux/gpio.h>

No. This is a sign that something is wrong, no driver should include
this unless it is using GPIOs as a resource itself.

> +       return (val & MAX77620_CNFG_GPIO_DIR_MASK) ?
> +               GPIOF_DIR_IN : GPIOF_DIR_OUT;

Just return 0 or 1. The driver-internal API isn't smarter than that.

Yours,
Linus Walleij

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/3] gpio: max77620: Configure interrupt trigger level Laxman Dewangan <ldewangan@nvidia.com> - 2016-05-24 15:30 +0200
  [PATCH 2/3] gpio: max77620: Implement gpio_get_direction callback Laxman Dewangan <ldewangan@nvidia.com> - 2016-05-24 15:30 +0200
    Re: [PATCH 2/3] gpio: max77620: Implement gpio_get_direction callback Linus Walleij <linus.walleij@linaro.org> - 2016-05-30 17:10 +0200
      Re: [PATCH 2/3] gpio: max77620: Implement gpio_get_direction callback Laxman Dewangan <ldewangan@nvidia.com> - 2016-05-31 08:10 +0200
  Re: [PATCH 1/3] gpio: max77620: Configure interrupt trigger level Linus Walleij <linus.walleij@linaro.org> - 2016-05-30 17:10 +0200

csiph-web