Re: [PATCH] Input: charlieplex_keypad - check gpiod_direction_output() return value
From: Dmitry Torokhov
Date: Fri Jul 24 2026 - 21:03:17 EST
On Thu, Jul 23, 2026 at 07:59:43AM +0530, kr494167@xxxxxxxxx wrote:
> From: Surendra Singh Chouhan <kr494167@xxxxxxxxx>
>
> charlieplex_keypad_scan_line() currently ignores the return value of
> gpiod_direction_output() when setting the active output line for scanning.
>
> If setting the GPIO direction fails (e.g. on I2C/SPI GPIO expanders or
> hardware errors), the function continues to sleep and read input values
> from an improperly configured GPIO line.
>
> Fix this by capturing the return value of gpiod_direction_output() and
> returning the error code immediately if it fails.
>
> Fixes: 2ca45e57ea02 ("Input: charlieplex_keypad - add GPIO charlieplex keypad")
> Signed-off-by: Surendra Singh Chouhan <kr494167@xxxxxxxxx>
Applied, thank you.
--
Dmitry