Re: [PATCH v1] gpiolib: Respect error code of ->get_direction()

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

 



On Tue, Jul 3, 2018 at 2:38 AM Andy Shevchenko
<andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:

> In case we try to lock GPIO pin as IRQ when something going wrong
> we print a misleading message.
>
> Correct this by checking an error code from ->get_direction() in
> gpiochip_lock_as_irq() and printing a corresponding message.
>
> Note, this doesn't change overall behavior because error code used to
> be recognized as direction output which anyway led to an abortion of
> request.
>
> Fixes: 9c10280d85c1 ("gpio: flush direction status in gpiochip_lock_as_irq()")
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
> Cc: Mika Westerberg <mika.westerberg@xxxxxxxxxxxxxxx>

OK per followup I stripped the Fixes tag and the last paragraph and
applied.

I am a bit worried that there might be platforms that have survived
by igoring any error code from get direction (interpreting it as
"input) but they will hopefully notice ... thanks to the new error
print.

Did you look around to see if some driver might be returning
error codes from get_direction()? I suspect mostly I2C-based
expanders and if it's an error it's an error and this is the right
thing to do but you never know what people are doing...

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