Skip to content

Commit

Permalink
drivers/video/backlight/lp855x_bl.c: use PAGE_SIZE for the sysfs read…
Browse files Browse the repository at this point in the history
… operation

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 <[email protected]>
Acked-by: Jingoo Han <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Kim, Milo authored and torvalds committed Apr 30, 2013
1 parent d1720b5 commit 6a7aeb1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/video/backlight/lp855x_bl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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,
Expand All @@ -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);
Expand Down

0 comments on commit 6a7aeb1

Please sign in to comment.