Skip to content

Commit 5a78d5d

Browse files
author
Bartosz Golaszewski
committed
gpio: sim: mark the GPIO chip as a one that can sleep
Simulated chips use a mutex for synchronization in driver callbacks so they must not be called from interrupt context. Set the can_sleep field of the GPIO chip to true to force users to only use threaded irqs. Fixes: cb8c474 ("gpio: sim: new testing module") Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Reviewed-by: Linus Walleij <[email protected]>
1 parent 6eaae19 commit 5a78d5d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/gpio/gpio-sim.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,7 @@ static int gpio_sim_add_bank(struct fwnode_handle *swnode, struct device *dev)
429429
gc->set_config = gpio_sim_set_config;
430430
gc->to_irq = gpio_sim_to_irq;
431431
gc->free = gpio_sim_free;
432+
gc->can_sleep = true;
432433

433434
ret = devm_gpiochip_add_data(dev, gc, chip);
434435
if (ret)

0 commit comments

Comments
 (0)