diff mbox series

[2/3] hwmon: (axi-fan-control) Make use of sysfs_emit()

Message ID 20240214-axi-fan-control-no-of-v1-2-43ca656fe2e3@analog.com (mailing list archive)
State Accepted
Headers show
Series hwmon: (axi-fan-control) Small improvements | expand

Commit Message

Nuno Sa Feb. 14, 2024, 2:36 p.m. UTC
Use sysfs_emit() instead of directly call sprintf().

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
---
 drivers/hwmon/axi-fan-control.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Guenter Roeck Feb. 14, 2024, 7:56 p.m. UTC | #1
On Wed, Feb 14, 2024 at 03:36:44PM +0100, Nuno Sa wrote:
> Use sysfs_emit() instead of directly call sprintf().
> 
> Signed-off-by: Nuno Sa <nuno.sa@analog.com>

Applied.

Thanks,
Guenter
diff mbox series

Patch

diff --git a/drivers/hwmon/axi-fan-control.c b/drivers/hwmon/axi-fan-control.c
index 8dfe3b6c5a17..efd42a4f5951 100644
--- a/drivers/hwmon/axi-fan-control.c
+++ b/drivers/hwmon/axi-fan-control.c
@@ -84,7 +84,7 @@  static ssize_t axi_fan_control_show(struct device *dev, struct device_attribute
 
 	temp = DIV_ROUND_CLOSEST_ULL(temp * 509314ULL, 65535) - 280230;
 
-	return sprintf(buf, "%u\n", temp);
+	return sysfs_emit(buf, "%u\n", temp);
 }
 
 static ssize_t axi_fan_control_store(struct device *dev, struct device_attribute *da,