Skip to content

Commit a40fe1f

Browse files
author
Bartosz Golaszewski
committed
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]>
1 parent 5f6d199 commit a40fe1f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/gpio/gpio-sim.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -986,8 +986,7 @@ gpio_sim_device_config_live_store(struct config_item *item,
986986

987987
mutex_lock(&dev->lock);
988988

989-
if ((!live && !gpio_sim_device_is_live_unlocked(dev)) ||
990-
(live && gpio_sim_device_is_live_unlocked(dev)))
989+
if (live == gpio_sim_device_is_live_unlocked(dev))
991990
ret = -EPERM;
992991
else if (live)
993992
ret = gpio_sim_device_activate_unlocked(dev);

0 commit comments

Comments
 (0)