aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/leds/leds-lp5521.c
diff options
context:
space:
mode:
authorKim, Milo <Milo.Kim@ti.com>2013-03-14 20:19:36 -0400
committerBryan Wu <cooloney@gmail.com>2013-04-01 14:04:50 -0400
commit24d321284745cbc593fba8115585329d48703704 (patch)
treee8c266b2b30024980e353ee26086318e02c73f22 /drivers/leds/leds-lp5521.c
parent313bf0b1a0eaeaac17ea8c4b748f16e28fce8b7a (diff)
leds: lp55xx: fix the sysfs read operation
According to a sysfs documentation(Documentation/filesystem/sysfs.txt), scnprintf() should be used in a read operation method. It guarantees safe buffer size(PAGE_SIZE) which is allocated by the sysfs. Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>
Diffstat (limited to 'drivers/leds/leds-lp5521.c')
-rw-r--r--drivers/leds/leds-lp5521.c3
1 files changed, 2 insertions, 1 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 */