]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drivers/video/backlight/lp855x_bl.c: use PAGE_SIZE for the sysfs read operation
authorKim, Milo <Milo.Kim@ti.com>
Tue, 26 Mar 2013 23:25:02 +0000 (10:25 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 4 Apr 2013 06:12:27 +0000 (17:12 +1100)
sysfs allocates PAGE_SIZE.  It is used by each R/W operation method.  Use
it instead of another buffer size.

Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/video/backlight/lp855x_bl.c

index 20111ef2f898c60919d02f3f0c049a72c81fe56b..c98bdbfdc697202a7bd584619d42f93dfb141361 100644 (file)
@@ -35,7 +35,6 @@
 #define LP8557_EPROM_START             0x10
 #define LP8557_EPROM_END               0x1E
 
-#define BUF_SIZE               20
 #define DEFAULT_BL_NAME                "lcd-backlight"
 #define MAX_BRIGHTNESS         255
 
@@ -304,7 +303,7 @@ static ssize_t lp855x_get_chip_id(struct device *dev,
                                struct device_attribute *attr, char *buf)
 {
        struct lp855x *lp = dev_get_drvdata(dev);
-       return scnprintf(buf, BUF_SIZE, "%s\n", lp->chipname);
+       return scnprintf(buf, PAGE_SIZE, "%s\n", lp->chipname);
 }
 
 static ssize_t lp855x_get_bl_ctl_mode(struct device *dev,
@@ -319,7 +318,7 @@ static ssize_t lp855x_get_bl_ctl_mode(struct device *dev,
        else if (mode == REGISTER_BASED)
                strmode = "register based";
 
-       return scnprintf(buf, BUF_SIZE, "%s\n", strmode);
+       return scnprintf(buf, PAGE_SIZE, "%s\n", strmode);
 }
 
 static DEVICE_ATTR(chip_id, S_IRUGO, lp855x_get_chip_id, NULL);