Re: [PATCH 1/2] omap3: igepv2: Don't call gpio_set_value right after gpio_direction_output

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

 



2010/12/12 Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>:
> gpio_direction_output() has a value argument, there's no need to call
> gpio_set_value() explicitly right after.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>
> ---
> Âarch/arm/mach-omap2/board-igep0020.c | Â 20 ++++++++------------
> Â1 files changed, 8 insertions(+), 12 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
> index 5e035a5..20b88c1 100644
> --- a/arch/arm/mach-omap2/board-igep0020.c
> +++ b/arch/arm/mach-omap2/board-igep0020.c
> @@ -342,24 +342,21 @@ static void __init igep2_leds_init(void)
> Âstatic inline void igep2_leds_init(void)
> Â{
> Â Â Â Âif ((gpio_request(IGEP2_GPIO_LED0_RED, "gpio-led:red:d0") == 0) &&
> - Â Â Â Â Â (gpio_direction_output(IGEP2_GPIO_LED0_RED, 1) == 0)) {
> + Â Â Â Â Â (gpio_direction_output(IGEP2_GPIO_LED0_RED, 0) == 0))
> Â Â Â Â Â Â Â Âgpio_export(IGEP2_GPIO_LED0_RED, 0);
> - Â Â Â Â Â Â Â gpio_set_value(IGEP2_GPIO_LED0_RED, 0);
> - Â Â Â } else
> + Â Â Â else
> Â Â Â Â Â Â Â Âpr_warning("IGEP v2: Could not obtain gpio GPIO_LED0_RED\n");
>
> Â Â Â Âif ((gpio_request(IGEP2_GPIO_LED0_GREEN, "gpio-led:green:d0") == 0) &&
> - Â Â Â Â Â (gpio_direction_output(IGEP2_GPIO_LED0_GREEN, 1) == 0)) {
> + Â Â Â Â Â (gpio_direction_output(IGEP2_GPIO_LED0_GREEN, 0) == 0))
> Â Â Â Â Â Â Â Âgpio_export(IGEP2_GPIO_LED0_GREEN, 0);
> - Â Â Â Â Â Â Â gpio_set_value(IGEP2_GPIO_LED0_GREEN, 0);
> - Â Â Â } else
> + Â Â Â else
> Â Â Â Â Â Â Â Âpr_warning("IGEP v2: Could not obtain gpio GPIO_LED0_GREEN\n");
>
> Â Â Â Âif ((gpio_request(IGEP2_GPIO_LED1_RED, "gpio-led:red:d1") == 0) &&
> - Â Â Â Â Â (gpio_direction_output(IGEP2_GPIO_LED1_RED, 1) == 0)) {
> + Â Â Â Â Â (gpio_direction_output(IGEP2_GPIO_LED1_RED, 0) == 0))
> Â Â Â Â Â Â Â Âgpio_export(IGEP2_GPIO_LED1_RED, 0);
> - Â Â Â Â Â Â Â gpio_set_value(IGEP2_GPIO_LED1_RED, 0);
> - Â Â Â } else
> + Â Â Â else
> Â Â Â Â Â Â Â Âpr_warning("IGEP v2: Could not obtain gpio GPIO_LED1_RED\n");
>
> Â}
> @@ -397,10 +394,9 @@ static int igep2_twl_gpio_setup(struct device *dev,
> Â Â Â Â/* TWL4030_GPIO_MAX + 1 == ledB (out, active low LED) */
> Â#if !defined(CONFIG_LEDS_GPIO) && !defined(CONFIG_LEDS_GPIO_MODULE)
> Â Â Â Âif ((gpio_request(gpio+TWL4030_GPIO_MAX+1, "gpio-led:green:d1") == 0)
> - Â Â Â Â Â && (gpio_direction_output(gpio + TWL4030_GPIO_MAX + 1, 1) == 0)) {
> + Â Â Â Â Â && (gpio_direction_output(gpio + TWL4030_GPIO_MAX + 1, 0) == 0))
> Â Â Â Â Â Â Â Âgpio_export(gpio + TWL4030_GPIO_MAX + 1, 0);
> - Â Â Â Â Â Â Â gpio_set_value(gpio + TWL4030_GPIO_MAX + 1, 0);
> - Â Â Â } else
> + Â Â Â else
> Â Â Â Â Â Â Â Âpr_warning("IGEP v2: Could not obtain gpio GPIO_LED1_GREEN\n");
> Â#else
> Â Â Â Âigep2_gpio_leds[3].gpio = gpio + TWL4030_GPIO_MAX + 1;
> --
> 1.7.2.2
>
>

Acked-by: Enric Balletbo i Serra <eballetbo@xxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux