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

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

 



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

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

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



[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