[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20221227103257.1431720-1-zhangxuezhi3@gmail.com>
Date: Tue, 27 Dec 2022 18:32:57 +0800
From: Xuezhi Zhang <zhangxuezhi3@...il.com>
To: zhangxuezhi1@...lpad.com, stuyoder@...il.com,
laurentiu.tudor@....com
Cc: linux-kernel@...r.kernel.org
Subject: [PATCH] bus: fsl-mc-bus: convert sysfs snprintf to sysfs_emit
From: Xuezhi Zhang <zhangxuezhi1@...lpad.com>
Follow the advice of the Documentation/filesystems/sysfs.rst
and show() should only use sysfs_emit() or sysfs_emit_at()
when formatting the value to be returned to user space.
Signed-off-by: Xuezhi Zhang <zhangxuezhi1@...lpad.com>
---
drivers/bus/fsl-mc/fsl-mc-bus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/bus/fsl-mc/fsl-mc-bus.c b/drivers/bus/fsl-mc/fsl-mc-bus.c
index 774f307844b4..e83d16a54c47 100644
--- a/drivers/bus/fsl-mc/fsl-mc-bus.c
+++ b/drivers/bus/fsl-mc/fsl-mc-bus.c
@@ -201,7 +201,7 @@ static ssize_t driver_override_show(struct device *dev,
{
struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev);
- return snprintf(buf, PAGE_SIZE, "%s\n", mc_dev->driver_override);
+ return sysfs_emit(buf, "%s\n", mc_dev->driver_override);
}
static DEVICE_ATTR_RW(driver_override);
--
2.25.1
Powered by blists - more mailing lists