Skip to content

Commit 46cab93

Browse files
bryanbrattlofDaniel Lezcano
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Daniel Lezcano <[email protected]>
1 parent 2baad24 commit 46cab93

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

drivers/thermal/k3_j72xx_bandgap.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -249,14 +249,7 @@ static inline int k3_bgp_read_temp(struct k3_thermal_data *devdata,
249249
/* Get temperature callback function for thermal zone */
250250
static int k3_thermal_get_temp(struct thermal_zone_device *tz, int *temp)
251251
{
252-
struct k3_thermal_data *data = tz->devdata;
253-
int ret = 0;
254-
255-
ret = k3_bgp_read_temp(data, temp);
256-
if (ret)
257-
return ret;
258-
259-
return ret;
252+
return k3_bgp_read_temp(tz->devdata, temp);
260253
}
261254

262255
static const struct thermal_zone_device_ops k3_of_thermal_ops = {

0 commit comments

Comments
 (0)