summaryrefslogtreecommitdiffstats
path: root/drivers/thermal/k3_j72xx_bandgap.c
diff options
context:
space:
mode:
authorBryan Brattlof <bb@ti.com>2022-10-31 18:26:52 -0500
committerDaniel Lezcano <daniel.lezcano@kernel.org>2022-12-14 15:25:40 +0100
commit46cab93ab49f303a7abbcf920cf9ef95d02a113c (patch)
treeb367472f32229f59d8b93d3f6a002b56181fad58 /drivers/thermal/k3_j72xx_bandgap.c
parent2baad2496383c6036bdb0945ef8aa6b1a5d18c19 (diff)
downloadlinux-46cab93ab49f303a7abbcf920cf9ef95d02a113c.tar.bz2
thermal/drivers/k3_j72xx_bandgap: Simplify k3_thermal_get_temp() function
The k3_thermal_get_temp() function can be simplified to return only the result of k3_bgp_read_temp() without needing the 'ret' variable Signed-off-by: Bryan Brattlof <bb@ti.com> Link: https://lore.kernel.org/r/20221031232702.10339-2-bb@ti.com Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Diffstat (limited to 'drivers/thermal/k3_j72xx_bandgap.c')
-rw-r--r--drivers/thermal/k3_j72xx_bandgap.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/thermal/k3_j72xx_bandgap.c b/drivers/thermal/k3_j72xx_bandgap.c
index c073b1023bbe..a9f99a190cb6 100644
--- a/drivers/thermal/k3_j72xx_bandgap.c
+++ b/drivers/thermal/k3_j72xx_bandgap.c
@@ -249,14 +249,7 @@ static inline int k3_bgp_read_temp(struct k3_thermal_data *devdata,
/* Get temperature callback function for thermal zone */
static int k3_thermal_get_temp(struct thermal_zone_device *tz, int *temp)
{
- struct k3_thermal_data *data = tz->devdata;
- int ret = 0;
-
- ret = k3_bgp_read_temp(data, temp);
- if (ret)
- return ret;
-
- return ret;
+ return k3_bgp_read_temp(tz->devdata, temp);
}
static const struct thermal_zone_device_ops k3_of_thermal_ops = {