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 May 22, 2024
1 parent c211cb3 commit 944f3be
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/gpio/gpio_pcal64xxa.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ 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);
k_sem_give(&drv_data->lock);
return rc;
}

Expand Down

0 comments on commit 944f3be

Please sign in to comment.