Skip to content

Commit

Permalink
drivers: gpio: pcal64xxa: give semaphore in case of error
Browse files Browse the repository at this point in the history
In function pcal64xxa_process_input, lock was not released in case of
error when calling inputs_read.
This was causing an infinite wait in the following calls of functions
using I2C bus.

Signed-off-by: Vincent Geneves <[email protected]>
  • Loading branch information
Vincent Geneves authored and vgeneves committed Feb 12, 2024
1 parent b15452b commit 6806964
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/gpio/gpio_pcal64xxa.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ static int pcal64xxa_process_input(const struct device *dev, gpio_port_value_t *

if (rc != 0) {
LOG_ERR("failed to read inputs from device %s", dev->name);
return rc;
k_sem_give(&drv_data->lock);
return rc
}

if (value) {
Expand Down

0 comments on commit 6806964

Please sign in to comment.