mirror of
https://github.com/torvalds/linux.git
synced 2026-05-23 22:52:19 +02:00
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>
This commit is contained in:
parent
5f6d1998ad
commit
a40fe1ffb6
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user