hwmon: (hih6130) Replace sprintf() with sysfs_emit()

Use sysfs_emit() instead of sprintf() in the sysfs show functions
hih6130_temperature_show() and hih6130_humidity_show() to use the
preferred kernel interface for writing to sysfs buffers.

No functional change intended.

Note: Not runtime tested due to lack of hardware.

Signed-off-by: Massinissa Ghoul <massigh680@gmail.com>
Link: https://patch.msgid.link/20260907-hwmon-hih6130-sysfs-emit-v1-1-a1adb5245d0f@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
Massinissa Ghoul 2026-09-07 00:35:02 +02:00 committed by Guenter Roeck
parent 2f312a9d6d
commit 0eff7c3547

View File

@ -168,7 +168,7 @@ static ssize_t hih6130_temperature_show(struct device *dev,
ret = hih6130_update_measurements(dev);
if (ret < 0)
return ret;
return sprintf(buf, "%d\n", hih6130->temperature);
return sysfs_emit(buf, "%d\n", hih6130->temperature);
}
/**
@ -189,7 +189,7 @@ static ssize_t hih6130_humidity_show(struct device *dev,
ret = hih6130_update_measurements(dev);
if (ret < 0)
return ret;
return sprintf(buf, "%d\n", hih6130->humidity);
return sysfs_emit(buf, "%d\n", hih6130->humidity);
}
/* sysfs attributes */