Re: [PATCH RFT] gpio: mpc8xxx: Fixup setting gpio direction output

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

 



On Thu, Feb 11, 2016 at 2:13 PM, Axel Lin <axel.lin@xxxxxxxxxx> wrote:

> For devtype with specific gpio_dir_out implementation, current code looks
> wrong because below code sets both gc->direction_output and
> mpc8xxx_gc->direction_output to the same function.
>
> gc->direction_output = devtype->gpio_dir_out ?: gc->direction_output;
> mpc8xxx_gc->direction_output = gc->direction_output;
>
> Set mpc8xxx_gc->direction_output = gc->direction_output first to fix it.
> This way mpc8xxx_gc->direction_output actually calls the standard
> bgpio_dir_out() to update register.
>
> Setting gc->direction_output to gc->direction_output looks strange.
> This patch also slightly changes the code for better readability.
>
> Fixes: commit 42178e2a1e42 ("drivers/gpio: Switch gpio-mpc8xxx to use gpio-generic")
> Signed-off-by: Axel Lin <axel.lin@xxxxxxxxxx>

Liu please comment on this patch.

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