aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/leds/leds-lp5521.c3
-rw-r--r--drivers/leds/leds-lp55xx-common.c4
2 files changed, 4 insertions, 3 deletions
diff --git a/drivers/leds/leds-lp5521.c b/drivers/leds/leds-lp5521.c
index 1001347ba70b..7f10304219ea 100644
--- a/drivers/leds/leds-lp5521.c
+++ b/drivers/leds/leds-lp5521.c
@@ -360,7 +360,8 @@ static ssize_t lp5521_selftest(struct device *dev,
360 mutex_lock(&chip->lock); 360 mutex_lock(&chip->lock);
361 ret = lp5521_run_selftest(chip, buf); 361 ret = lp5521_run_selftest(chip, buf);
362 mutex_unlock(&chip->lock); 362 mutex_unlock(&chip->lock);
363 return sprintf(buf, "%s\n", ret ? "FAIL" : "OK"); 363
364 return scnprintf(buf, PAGE_SIZE, "%s\n", ret ? "FAIL" : "OK");
364} 365}
365 366
366/* device attributes */ 367/* device attributes */
diff --git a/drivers/leds/leds-lp55xx-common.c b/drivers/leds/leds-lp55xx-common.c
index 8a388a4afed7..715a6027316f 100644
--- a/drivers/leds/leds-lp55xx-common.c
+++ b/drivers/leds/leds-lp55xx-common.c
@@ -80,7 +80,7 @@ static ssize_t lp55xx_show_current(struct device *dev,
80{ 80{
81 struct lp55xx_led *led = dev_to_lp55xx_led(dev); 81 struct lp55xx_led *led = dev_to_lp55xx_led(dev);
82 82
83 return sprintf(buf, "%d\n", led->led_current); 83 return scnprintf(buf, PAGE_SIZE, "%d\n", led->led_current);
84} 84}
85 85
86static ssize_t lp55xx_store_current(struct device *dev, 86static ssize_t lp55xx_store_current(struct device *dev,
@@ -113,7 +113,7 @@ static ssize_t lp55xx_show_max_current(struct device *dev,
113{ 113{
114 struct lp55xx_led *led = dev_to_lp55xx_led(dev); 114 struct lp55xx_led *led = dev_to_lp55xx_led(dev);
115 115
116 return sprintf(buf, "%d\n", led->max_current); 116 return scnprintf(buf, PAGE_SIZE, "%d\n", led->max_current);
117} 117}
118 118
119static DEVICE_ATTR(led_current, S_IRUGO | S_IWUSR, lp55xx_show_current, 119static DEVICE_ATTR(led_current, S_IRUGO | S_IWUSR, lp55xx_show_current,