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>
This commit is contained in:
parent
d7696214b0
commit
37f665ffa8
@ -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;
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user