Commit 2cb96f86 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Linus Torvalds

fbdev: drop custom atoi from drivers/video/modedb.c

Kernel has simple_strtol() implementation which could be used as atoi().
Signed-off-by: default avatarAndy Shevchenko <ext-andriy.shevchenko@nokia.com>
Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 5ab94815
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/fb.h> #include <linux/fb.h>
#include <linux/kernel.h>
#undef DEBUG #undef DEBUG
...@@ -402,21 +403,6 @@ const struct fb_videomode vesa_modes[] = { ...@@ -402,21 +403,6 @@ const struct fb_videomode vesa_modes[] = {
EXPORT_SYMBOL(vesa_modes); EXPORT_SYMBOL(vesa_modes);
#endif /* CONFIG_FB_MODE_HELPERS */ #endif /* CONFIG_FB_MODE_HELPERS */
static int my_atoi(const char *name)
{
int val = 0;
for (;; name++) {
switch (*name) {
case '0' ... '9':
val = 10*val+(*name-'0');
break;
default:
return val;
}
}
}
/** /**
* fb_try_mode - test a video mode * fb_try_mode - test a video mode
* @var: frame buffer user defined part of display * @var: frame buffer user defined part of display
...@@ -539,7 +525,7 @@ int fb_find_mode(struct fb_var_screeninfo *var, ...@@ -539,7 +525,7 @@ int fb_find_mode(struct fb_var_screeninfo *var,
namelen = i; namelen = i;
if (!refresh_specified && !bpp_specified && if (!refresh_specified && !bpp_specified &&
!yres_specified) { !yres_specified) {
refresh = my_atoi(&name[i+1]); refresh = simple_strtol(&name[i+1], NULL, 10);
refresh_specified = 1; refresh_specified = 1;
if (cvt || rb) if (cvt || rb)
cvt = 0; cvt = 0;
...@@ -549,7 +535,7 @@ int fb_find_mode(struct fb_var_screeninfo *var, ...@@ -549,7 +535,7 @@ int fb_find_mode(struct fb_var_screeninfo *var,
case '-': case '-':
namelen = i; namelen = i;
if (!bpp_specified && !yres_specified) { if (!bpp_specified && !yres_specified) {
bpp = my_atoi(&name[i+1]); bpp = simple_strtol(&name[i+1], NULL, 10);
bpp_specified = 1; bpp_specified = 1;
if (cvt || rb) if (cvt || rb)
cvt = 0; cvt = 0;
...@@ -558,7 +544,7 @@ int fb_find_mode(struct fb_var_screeninfo *var, ...@@ -558,7 +544,7 @@ int fb_find_mode(struct fb_var_screeninfo *var,
break; break;
case 'x': case 'x':
if (!yres_specified) { if (!yres_specified) {
yres = my_atoi(&name[i+1]); yres = simple_strtol(&name[i+1], NULL, 10);
yres_specified = 1; yres_specified = 1;
} else } else
goto done; goto done;
...@@ -586,7 +572,7 @@ int fb_find_mode(struct fb_var_screeninfo *var, ...@@ -586,7 +572,7 @@ int fb_find_mode(struct fb_var_screeninfo *var,
} }
} }
if (i < 0 && yres_specified) { if (i < 0 && yres_specified) {
xres = my_atoi(name); xres = simple_strtol(name, NULL, 10);
res_specified = 1; res_specified = 1;
} }
done: done:
......
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