Message ID | 20230811131427.40466-1-brgl@bgdev.pl |
---|---|
State | New |
Headers | show |
Series | [1/2] gpio: sim: simplify gpio_sim_device_config_live_store() | expand |
diff --git a/drivers/gpio/gpio-sim.c b/drivers/gpio/gpio-sim.c index dc4097dc0fbc..0177b41e0d72 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);