diff --git a/drivers/input/keyboard/charlieplex_keypad.c b/drivers/input/keyboard/charlieplex_keypad.c index d222b622c820..d46a2298e6da 100644 --- a/drivers/input/keyboard/charlieplex_keypad.c +++ b/drivers/input/keyboard/charlieplex_keypad.c @@ -77,7 +77,9 @@ static int charlieplex_keypad_scan_line(struct charlieplex_keypad *keypad, int err; /* Activate only one line as output at a time. */ - gpiod_direction_output(line_gpios->desc[oline], 1); + err = gpiod_direction_output(line_gpios->desc[oline], 1); + if (err) + return err; if (keypad->settling_time_us) fsleep(keypad->settling_time_us);