aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/omapfb/omapfb-sysfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/omap2/omapfb/omapfb-sysfs.c')
-rw-r--r--drivers/video/omap2/omapfb/omapfb-sysfs.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/drivers/video/omap2/omapfb/omapfb-sysfs.c b/drivers/video/omap2/omapfb/omapfb-sysfs.c
index 6f9c72cd6bb0..2f5e817b2a9a 100644
--- a/drivers/video/omap2/omapfb/omapfb-sysfs.c
+++ b/drivers/video/omap2/omapfb/omapfb-sysfs.c
@@ -29,7 +29,7 @@
29#include <linux/mm.h> 29#include <linux/mm.h>
30#include <linux/omapfb.h> 30#include <linux/omapfb.h>
31 31
32#include <plat/display.h> 32#include <video/omapdss.h>
33#include <plat/vrfb.h> 33#include <plat/vrfb.h>
34 34
35#include "omapfb.h" 35#include "omapfb.h"
@@ -50,10 +50,12 @@ static ssize_t store_rotate_type(struct device *dev,
50 struct fb_info *fbi = dev_get_drvdata(dev); 50 struct fb_info *fbi = dev_get_drvdata(dev);
51 struct omapfb_info *ofbi = FB2OFB(fbi); 51 struct omapfb_info *ofbi = FB2OFB(fbi);
52 struct omapfb2_mem_region *rg; 52 struct omapfb2_mem_region *rg;
53 enum omap_dss_rotation_type rot_type; 53 int rot_type;
54 int r; 54 int r;
55 55
56 rot_type = simple_strtoul(buf, NULL, 0); 56 r = kstrtoint(buf, 0, &rot_type);
57 if (r)
58 return r;
57 59
58 if (rot_type != OMAP_DSS_ROT_DMA && rot_type != OMAP_DSS_ROT_VRFB) 60 if (rot_type != OMAP_DSS_ROT_DMA && rot_type != OMAP_DSS_ROT_VRFB)
59 return -EINVAL; 61 return -EINVAL;
@@ -102,14 +104,15 @@ static ssize_t store_mirror(struct device *dev,
102{ 104{
103 struct fb_info *fbi = dev_get_drvdata(dev); 105 struct fb_info *fbi = dev_get_drvdata(dev);
104 struct omapfb_info *ofbi = FB2OFB(fbi); 106 struct omapfb_info *ofbi = FB2OFB(fbi);
105 unsigned long mirror; 107 int mirror;
106 int r; 108 int r;
107 struct fb_var_screeninfo new_var; 109 struct fb_var_screeninfo new_var;
108 110
109 mirror = simple_strtoul(buf, NULL, 0); 111 r = kstrtoint(buf, 0, &mirror);
112 if (r)
113 return r;
110 114
111 if (mirror != 0 && mirror != 1) 115 mirror = !!mirror;
112 return -EINVAL;
113 116
114 if (!lock_fb_info(fbi)) 117 if (!lock_fb_info(fbi))
115 return -ENODEV; 118 return -ENODEV;
@@ -445,7 +448,11 @@ static ssize_t store_size(struct device *dev, struct device_attribute *attr,
445 int r; 448 int r;
446 int i; 449 int i;
447 450
448 size = PAGE_ALIGN(simple_strtoul(buf, NULL, 0)); 451 r = kstrtoul(buf, 0, &size);
452 if (r)
453 return r;
454
455 size = PAGE_ALIGN(size);
449 456
450 if (!lock_fb_info(fbi)) 457 if (!lock_fb_info(fbi))
451 return -ENODEV; 458 return -ENODEV;