Skip to content

Commit b8cd871

Browse files
Bartosz Golaszewskigregkh
authored andcommitted
gpio: sim: mark the GPIO chip as a one that can sleep
commit 5a78d5d upstream. 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 <bartosz.golaszewski@linaro.org> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 227bd2c commit b8cd871

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
@@ -425,6 +425,7 @@ static int gpio_sim_add_bank(struct fwnode_handle *swnode, struct device *dev)
425425
gc->set_config = gpio_sim_set_config;
426426
gc->to_irq = gpio_sim_to_irq;
427427
gc->free = gpio_sim_free;
428+
gc->can_sleep = true;
428429

429430
ret = devm_gpiochip_add_data(dev, gc, chip);
430431
if (ret)

0 commit comments

Comments
 (0)