summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoaquín Ignacio Aramendía <samsagax@gmail.com>2023-06-17 21:11:43 +0300
committerGuenter Roeck <linux@roeck-us.net>2023-06-18 18:54:31 +0300
commit37f665ffa886ce49d1baaca1c3501ce93713b77e (patch)
treec72d320d71dcd1001d08b6808c6f4f4cf22f4bdf
parentd7696214b06dae06b5c632142b1c80cf85219c74 (diff)
downloadlinux-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.c7
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;
}