diff options
author | Bartosz Golaszewski <bartosz.golaszewski@linaro.org> | 2023-08-11 15:14:26 +0200 |
---|---|---|
committer | Bartosz Golaszewski <bartosz.golaszewski@linaro.org> | 2023-08-12 20:27:51 +0200 |
commit | a40fe1ffb69b709835a0623959f95d6c81ff38c1 (patch) | |
tree | 6d78524c9bdf2e1e2c1c7fd6548dd083587dbe93 /drivers/gpio | |
parent | gpio: mxc: release the parent IRQ in runtime suspend (diff) | |
download | linux-a40fe1ffb69b709835a0623959f95d6c81ff38c1.tar.xz linux-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 <bartosz.golaszewski@linaro.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Diffstat (limited to 'drivers/gpio')
-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); |