Commit b20a558d authored by ye xingchen's avatar ye xingchen Committed by Helge Deller

fbdev: sh_mobile_lcdcfb: use sysfs_emit() to instead of scnprintf()

Follow the advice of the Documentation/filesystems/sysfs.rst and show()
should only use sysfs_emit() or sysfs_emit_at() when formatting the
value to be returned to user space.
Signed-off-by: default avatarye xingchen <ye.xingchen@zte.com.cn>
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
parent 522d5226
...@@ -1188,7 +1188,7 @@ overlay_alpha_show(struct device *dev, struct device_attribute *attr, char *buf) ...@@ -1188,7 +1188,7 @@ overlay_alpha_show(struct device *dev, struct device_attribute *attr, char *buf)
struct fb_info *info = dev_get_drvdata(dev); struct fb_info *info = dev_get_drvdata(dev);
struct sh_mobile_lcdc_overlay *ovl = info->par; struct sh_mobile_lcdc_overlay *ovl = info->par;
return scnprintf(buf, PAGE_SIZE, "%u\n", ovl->alpha); return sysfs_emit(buf, "%u\n", ovl->alpha);
} }
static ssize_t static ssize_t
...@@ -1226,7 +1226,7 @@ overlay_mode_show(struct device *dev, struct device_attribute *attr, char *buf) ...@@ -1226,7 +1226,7 @@ overlay_mode_show(struct device *dev, struct device_attribute *attr, char *buf)
struct fb_info *info = dev_get_drvdata(dev); struct fb_info *info = dev_get_drvdata(dev);
struct sh_mobile_lcdc_overlay *ovl = info->par; struct sh_mobile_lcdc_overlay *ovl = info->par;
return scnprintf(buf, PAGE_SIZE, "%u\n", ovl->mode); return sysfs_emit(buf, "%u\n", ovl->mode);
} }
static ssize_t static ssize_t
...@@ -1265,7 +1265,7 @@ overlay_position_show(struct device *dev, struct device_attribute *attr, ...@@ -1265,7 +1265,7 @@ overlay_position_show(struct device *dev, struct device_attribute *attr,
struct fb_info *info = dev_get_drvdata(dev); struct fb_info *info = dev_get_drvdata(dev);
struct sh_mobile_lcdc_overlay *ovl = info->par; struct sh_mobile_lcdc_overlay *ovl = info->par;
return scnprintf(buf, PAGE_SIZE, "%d,%d\n", ovl->pos_x, ovl->pos_y); return sysfs_emit(buf, "%d,%d\n", ovl->pos_x, ovl->pos_y);
} }
static ssize_t static ssize_t
...@@ -1306,7 +1306,7 @@ overlay_rop3_show(struct device *dev, struct device_attribute *attr, char *buf) ...@@ -1306,7 +1306,7 @@ overlay_rop3_show(struct device *dev, struct device_attribute *attr, char *buf)
struct fb_info *info = dev_get_drvdata(dev); struct fb_info *info = dev_get_drvdata(dev);
struct sh_mobile_lcdc_overlay *ovl = info->par; struct sh_mobile_lcdc_overlay *ovl = info->par;
return scnprintf(buf, PAGE_SIZE, "%u\n", ovl->rop3); return sysfs_emit(buf, "%u\n", ovl->rop3);
} }
static ssize_t static ssize_t
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment