diff options
author | Joaquín Ignacio Aramendía <samsagax@gmail.com> | 2023-06-17 21:11:43 +0300 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2023-06-18 18:54:31 +0300 |
commit | 37f665ffa886ce49d1baaca1c3501ce93713b77e (patch) | |
tree | c72d320d71dcd1001d08b6808c6f4f4cf22f4bdf | |
parent | d7696214b06dae06b5c632142b1c80cf85219c74 (diff) | |
download | linux-37f665ffa886ce49d1baaca1c3501ce93713b77e.tar.xz |
hwmon: (oxp-sensors) Simplify logic of error return
Take return logic on error out of if-else, eliminating
duplicated code in tt_togle_store() function.
Signed-off-by: Joaquín Ignacio Aramendía <samsagax@gmail.com>
Link: https://lore.kernel.org/r/20230617181159.32844-3-samsagax@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-rw-r--r-- | drivers/hwmon/oxp-sensors.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/hwmon/oxp-sensors.c b/drivers/hwmon/oxp-sensors.c index 584e48d8106e..1e59d97219c4 100644 --- a/drivers/hwmon/oxp-sensors.c +++ b/drivers/hwmon/oxp-sensors.c @@ -226,13 +226,12 @@ static ssize_t tt_toggle_store(struct device *dev, if (value) { rval = tt_toggle_enable(); - if (rval) - return rval; } else { rval = tt_toggle_disable(); - if (rval) - return rval; } + if (rval) + return rval; + return count; } |