Skip to content

Commit ee9fffd

Browse files
tititiou36hdeller
authored andcommitted
fbdev: omapfb: Use kstrtobool() instead of strtobool()
strtobool() is the same as kstrtobool(). However, the latter is more used within the kernel. In order to remove strtobool() and slightly simplify kstrtox.h, switch to the other function name. While at it, include the corresponding header file (<linux/kstrtox.h>) Signed-off-by: Christophe JAILLET <[email protected]> Signed-off-by: Helge Deller <[email protected]>
1 parent 67a90bc commit ee9fffd

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

drivers/video/fbdev/omap2/omapfb/dss/display-sysfs.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#define DSS_SUBSYS_NAME "DISPLAY"
1111

1212
#include <linux/kernel.h>
13+
#include <linux/kstrtox.h>
1314
#include <linux/module.h>
1415
#include <linux/platform_device.h>
1516
#include <linux/sysfs.h>
@@ -36,7 +37,7 @@ static ssize_t display_enabled_store(struct omap_dss_device *dssdev,
3637
int r;
3738
bool enable;
3839

39-
r = strtobool(buf, &enable);
40+
r = kstrtobool(buf, &enable);
4041
if (r)
4142
return r;
4243

@@ -73,7 +74,7 @@ static ssize_t display_tear_store(struct omap_dss_device *dssdev,
7374
if (!dssdev->driver->enable_te || !dssdev->driver->get_te)
7475
return -ENOENT;
7576

76-
r = strtobool(buf, &te);
77+
r = kstrtobool(buf, &te);
7778
if (r)
7879
return r;
7980

@@ -183,7 +184,7 @@ static ssize_t display_mirror_store(struct omap_dss_device *dssdev,
183184
if (!dssdev->driver->set_mirror || !dssdev->driver->get_mirror)
184185
return -ENOENT;
185186

186-
r = strtobool(buf, &mirror);
187+
r = kstrtobool(buf, &mirror);
187188
if (r)
188189
return r;
189190

drivers/video/fbdev/omap2/omapfb/dss/manager-sysfs.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#define DSS_SUBSYS_NAME "MANAGER"
1111

1212
#include <linux/kernel.h>
13+
#include <linux/kstrtox.h>
1314
#include <linux/slab.h>
1415
#include <linux/module.h>
1516
#include <linux/platform_device.h>
@@ -246,7 +247,7 @@ static ssize_t manager_trans_key_enabled_store(struct omap_overlay_manager *mgr,
246247
bool enable;
247248
int r;
248249

249-
r = strtobool(buf, &enable);
250+
r = kstrtobool(buf, &enable);
250251
if (r)
251252
return r;
252253

@@ -290,7 +291,7 @@ static ssize_t manager_alpha_blending_enabled_store(
290291
if(!dss_has_feature(FEAT_ALPHA_FIXED_ZORDER))
291292
return -ENODEV;
292293

293-
r = strtobool(buf, &enable);
294+
r = kstrtobool(buf, &enable);
294295
if (r)
295296
return r;
296297

@@ -329,7 +330,7 @@ static ssize_t manager_cpr_enable_store(struct omap_overlay_manager *mgr,
329330
if (!dss_has_feature(FEAT_CPR))
330331
return -ENODEV;
331332

332-
r = strtobool(buf, &enable);
333+
r = kstrtobool(buf, &enable);
333334
if (r)
334335
return r;
335336

drivers/video/fbdev/omap2/omapfb/dss/overlay-sysfs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <linux/err.h>
1414
#include <linux/sysfs.h>
1515
#include <linux/kobject.h>
16+
#include <linux/kstrtox.h>
1617
#include <linux/platform_device.h>
1718

1819
#include <video/omapfb_dss.h>
@@ -210,7 +211,7 @@ static ssize_t overlay_enabled_store(struct omap_overlay *ovl, const char *buf,
210211
int r;
211212
bool enable;
212213

213-
r = strtobool(buf, &enable);
214+
r = kstrtobool(buf, &enable);
214215
if (r)
215216
return r;
216217

drivers/video/fbdev/omap2/omapfb/omapfb-sysfs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <linux/uaccess.h>
1616
#include <linux/platform_device.h>
1717
#include <linux/kernel.h>
18+
#include <linux/kstrtox.h>
1819
#include <linux/mm.h>
1920
#include <linux/omapfb.h>
2021

@@ -96,7 +97,7 @@ static ssize_t store_mirror(struct device *dev,
9697
int r;
9798
struct fb_var_screeninfo new_var;
9899

99-
r = strtobool(buf, &mirror);
100+
r = kstrtobool(buf, &mirror);
100101
if (r)
101102
return r;
102103

0 commit comments

Comments
 (0)