diff options
author | Guo Zhengkui <guozhengkui@vivo.com> | 2021-11-19 08:31:26 +0100 |
---|---|---|
committer | Helge Deller <deller@gmx.de> | 2022-02-11 11:13:21 +0100 |
commit | 0d84dcab5cf842011ed09ff52b8cd759c7e64d2a (patch) | |
tree | 6e468d516341d398a530e24d2c8644d119142681 /drivers | |
parent | video: fbdev: s3c-fb: Use platform_get_irq() to get the interrupt (diff) | |
download | linux-0d84dcab5cf842011ed09ff52b8cd759c7e64d2a.tar.xz linux-0d84dcab5cf842011ed09ff52b8cd759c7e64d2a.zip |
video: fbdev: omapfb: Use sysfs_emit() instead of snprintf()
Use sysfs_emit() instead of snprintf().
Signed-off-by: Guo Zhengkui <guozhengkui@vivo.com>
Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/fbdev/omap/omapfb_main.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/video/fbdev/omap/omapfb_main.c b/drivers/video/fbdev/omap/omapfb_main.c index b495c09e6102..083388a4ceeb 100644 --- a/drivers/video/fbdev/omap/omapfb_main.c +++ b/drivers/video/fbdev/omap/omapfb_main.c @@ -16,6 +16,7 @@ #include <linux/slab.h> #include <linux/uaccess.h> #include <linux/module.h> +#include <linux/sysfs.h> #include <linux/omap-dma.h> @@ -1303,7 +1304,7 @@ static ssize_t omapfb_show_panel_name(struct device *dev, { struct omapfb_device *fbdev = dev_get_drvdata(dev); - return snprintf(buf, PAGE_SIZE, "%s\n", fbdev->panel->name); + return sysfs_emit(buf, "%s\n", fbdev->panel->name); } static ssize_t omapfb_show_bklight_level(struct device *dev, @@ -1314,8 +1315,8 @@ static ssize_t omapfb_show_bklight_level(struct device *dev, int r; if (fbdev->panel->get_bklight_level) { - r = snprintf(buf, PAGE_SIZE, "%d\n", - fbdev->panel->get_bklight_level(fbdev->panel)); + r = sysfs_emit(buf, "%d\n", + fbdev->panel->get_bklight_level(fbdev->panel)); } else r = -ENODEV; return r; @@ -1348,8 +1349,8 @@ static ssize_t omapfb_show_bklight_max(struct device *dev, int r; if (fbdev->panel->get_bklight_level) { - r = snprintf(buf, PAGE_SIZE, "%d\n", - fbdev->panel->get_bklight_max(fbdev->panel)); + r = sysfs_emit(buf, "%d\n", + fbdev->panel->get_bklight_max(fbdev->panel)); } else r = -ENODEV; return r; @@ -1379,7 +1380,7 @@ static ssize_t omapfb_show_ctrl_name(struct device *dev, { struct omapfb_device *fbdev = dev_get_drvdata(dev); - return snprintf(buf, PAGE_SIZE, "%s\n", fbdev->ctrl->name); + return sysfs_emit(buf, "%s\n", fbdev->ctrl->name); } static struct device_attribute dev_attr_ctrl_name = |