[PATCH 1/2] spi: bcm63xx-hsspi: Use sysfs_emit() instead of sprintf()

From: Aayush Kumar

Date: Fri Oct 09 2026 - 09:54:24 EST


show() should only use sysfs_emit() or sysfs_emit_at() when formatting
the value to be returned to user space.

Signed-off-by: Aayush Kumar <code@xxxxxxxxxxx>
---
drivers/spi/spi-bcm63xx-hsspi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-bcm63xx-hsspi.c b/drivers/spi/spi-bcm63xx-hsspi.c
index 25f169a2a..824e36bed 100644
--- a/drivers/spi/spi-bcm63xx-hsspi.c
+++ b/drivers/spi/spi-bcm63xx-hsspi.c
@@ -152,7 +152,7 @@ static ssize_t wait_mode_show(struct device *dev, struct device_attribute *attr,
struct spi_controller *ctrl = dev_get_drvdata(dev);
struct bcm63xx_hsspi *bs = spi_controller_get_devdata(ctrl);

- return sprintf(buf, "%d\n", bs->wait_mode);
+ return sysfs_emit(buf, "%d\n", bs->wait_mode);
}

static ssize_t wait_mode_store(struct device *dev, struct device_attribute *attr,
@@ -188,7 +188,7 @@ static ssize_t xfer_mode_show(struct device *dev, struct device_attribute *attr,
struct spi_controller *ctrl = dev_get_drvdata(dev);
struct bcm63xx_hsspi *bs = spi_controller_get_devdata(ctrl);

- return sprintf(buf, "%d\n", bs->xfer_mode);
+ return sysfs_emit(buf, "%d\n", bs->xfer_mode);
}

static ssize_t xfer_mode_store(struct device *dev, struct device_attribute *attr,
--
2.56.0