diff options
| author | Bartosz Golaszewski <[email protected]> | 2023-08-11 13:14:26 +0000 |
|---|---|---|
| committer | Bartosz Golaszewski <[email protected]> | 2023-08-12 18:27:51 +0000 |
| commit | a40fe1ffb69b709835a0623959f95d6c81ff38c1 (patch) | |
| tree | 6d78524c9bdf2e1e2c1c7fd6548dd083587dbe93 | |
| parent | gpio: mxc: release the parent IRQ in runtime suspend (diff) | |
| download | kernel-a40fe1ffb69b709835a0623959f95d6c81ff38c1.tar.gz kernel-a40fe1ffb69b709835a0623959f95d6c81ff38c1.zip | |
gpio: sim: simplify gpio_sim_device_config_live_store()
Simplify the logic when checking the current live value against the user
input.
Signed-off-by: Bartosz Golaszewski <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
| -rw-r--r-- | drivers/gpio/gpio-sim.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/gpio/gpio-sim.c b/drivers/gpio/gpio-sim.c index 1a3729eb44eb..1fbbb49985f6 100644 --- a/drivers/gpio/gpio-sim.c +++ b/drivers/gpio/gpio-sim.c @@ -986,8 +986,7 @@ gpio_sim_device_config_live_store(struct config_item *item, mutex_lock(&dev->lock); - if ((!live && !gpio_sim_device_is_live_unlocked(dev)) || - (live && gpio_sim_device_is_live_unlocked(dev))) + if (live == gpio_sim_device_is_live_unlocked(dev)) ret = -EPERM; else if (live) ret = gpio_sim_device_activate_unlocked(dev); |
