[PATCH] thermal: sysfs: Fix indentation in create_s32_tzp_attr()
From: Thorsten Blum
Date: Fri Oct 02 2026 - 20:01:15 EST
Indent the show callback consistently with the store callback and use an
early return if the thermal zone parameters are not available.
Signed-off-by: Thorsten Blum <blum@xxxxxxxxxx>
---
drivers/thermal/thermal_sysfs.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/thermal/thermal_sysfs.c b/drivers/thermal/thermal_sysfs.c
index 96fe5d591a0a..47daba943a76 100644
--- a/drivers/thermal/thermal_sysfs.c
+++ b/drivers/thermal/thermal_sysfs.c
@@ -287,12 +287,12 @@ sustainable_power_store(struct device *dev, struct device_attribute *devattr,
name##_show(struct device *dev, struct device_attribute *devattr, \
char *buf) \
{ \
- struct thermal_zone_device *tz = to_thermal_zone(dev); \
+ struct thermal_zone_device *tz = to_thermal_zone(dev); \
+ \
+ if (!tz->tzp) \
+ return -EIO; \
\
- if (tz->tzp) \
return sysfs_emit(buf, "%d\n", tz->tzp->name); \
- else \
- return -EIO; \
} \
\
static ssize_t \