diff options
author | Bartosz Golaszewski <bartosz.golaszewski@linaro.org> | 2023-08-11 16:14:26 +0300 |
---|---|---|
committer | Bartosz Golaszewski <bartosz.golaszewski@linaro.org> | 2023-08-12 21:27:51 +0300 |
commit | a40fe1ffb69b709835a0623959f95d6c81ff38c1 (patch) | |
tree | 6d78524c9bdf2e1e2c1c7fd6548dd083587dbe93 /drivers/gpio/gpio-sim.c | |
parent | 5f6d1998adeb5374ef248b5ba2e2a0c30ab0f60b (diff) | |
download | linux-a40fe1ffb69b709835a0623959f95d6c81ff38c1.tar.xz |
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/gpio-sim.c')
-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); |