[PATCH 2/3] leds: leds-lp5523: Convert to sysfs_emit API

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Convert sprintf to the much safer sysfs_emit API to handle output for
sysfs.

Signed-off-by: Christian Marangi <ansuelsmth@xxxxxxxxx>
---
 drivers/leds/leds-lp5523.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/leds/leds-lp5523.c b/drivers/leds/leds-lp5523.c
index 57df920192d2..095060533d1a 100644
--- a/drivers/leds/leds-lp5523.c
+++ b/drivers/leds/leds-lp5523.c
@@ -245,8 +245,8 @@ static ssize_t lp5523_selftest(struct device *dev,
 			goto fail;
 
 		if (adc >= vdd || adc < LP5523_ADC_SHORTCIRC_LIM)
-			pos += sprintf(buf + pos, "LED %d FAIL\n",
-				       led->chan_nr);
+			pos += sysfs_emit_at(buf, pos, "LED %d FAIL\n",
+					     led->chan_nr);
 
 		lp55xx_write(chip, LP5523_REG_LED_PWM_BASE + led->chan_nr,
 			     0x00);
@@ -257,10 +257,10 @@ static ssize_t lp5523_selftest(struct device *dev,
 		led++;
 	}
 	if (pos == 0)
-		pos = sprintf(buf, "OK\n");
+		pos = sysfs_emit(buf, "OK\n");
 	goto release_lock;
 fail:
-	pos = sprintf(buf, "FAIL\n");
+	pos = sysfs_emit(buf, "FAIL\n");
 
 release_lock:
 	mutex_unlock(&chip->lock);
-- 
2.45.1





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux