projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d769621
)
hwmon: (oxp-sensors) Simplify logic of error return
author
Joaquín Ignacio Aramendía
<samsagax@gmail.com>
Sat, 17 Jun 2023 18:11:43 +0000
(15:11 -0300)
committer
Guenter Roeck
<linux@roeck-us.net>
Sun, 18 Jun 2023 15:54:31 +0000
(08:54 -0700)
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>
drivers/hwmon/oxp-sensors.c
patch
|
blob
|
history
diff --git
a/drivers/hwmon/oxp-sensors.c
b/drivers/hwmon/oxp-sensors.c
index
584e48d
..
1e59d97
100644
(file)
--- 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;
}