diff options
author | Andy Shevchenko <ext-andriy.shevchenko@nokia.com> | 2009-12-15 19:46:24 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-16 10:20:01 -0500 |
commit | 2cb96f86628d6e97fcbda5fe4d8d74876239834c (patch) | |
tree | 9bc7b4f130e3d4bbc7d747563fa46e7be09ab560 /drivers/video/modedb.c | |
parent | 5ab948153a1e409afdc0f78a376ad3710df5b109 (diff) |
fbdev: drop custom atoi from drivers/video/modedb.c
Kernel has simple_strtol() implementation which could be used as atoi().
Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/modedb.c')
-rw-r--r-- | drivers/video/modedb.c | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/drivers/video/modedb.c b/drivers/video/modedb.c index 34e4e7995169..0129f1bc3522 100644 --- a/drivers/video/modedb.c +++ b/drivers/video/modedb.c | |||
@@ -13,6 +13,7 @@ | |||
13 | 13 | ||
14 | #include <linux/module.h> | 14 | #include <linux/module.h> |
15 | #include <linux/fb.h> | 15 | #include <linux/fb.h> |
16 | #include <linux/kernel.h> | ||
16 | 17 | ||
17 | #undef DEBUG | 18 | #undef DEBUG |
18 | 19 | ||
@@ -402,21 +403,6 @@ const struct fb_videomode vesa_modes[] = { | |||
402 | EXPORT_SYMBOL(vesa_modes); | 403 | EXPORT_SYMBOL(vesa_modes); |
403 | #endif /* CONFIG_FB_MODE_HELPERS */ | 404 | #endif /* CONFIG_FB_MODE_HELPERS */ |
404 | 405 | ||
405 | static int my_atoi(const char *name) | ||
406 | { | ||
407 | int val = 0; | ||
408 | |||
409 | for (;; name++) { | ||
410 | switch (*name) { | ||
411 | case '0' ... '9': | ||
412 | val = 10*val+(*name-'0'); | ||
413 | break; | ||
414 | default: | ||
415 | return val; | ||
416 | } | ||
417 | } | ||
418 | } | ||
419 | |||
420 | /** | 406 | /** |
421 | * fb_try_mode - test a video mode | 407 | * fb_try_mode - test a video mode |
422 | * @var: frame buffer user defined part of display | 408 | * @var: frame buffer user defined part of display |
@@ -539,7 +525,7 @@ int fb_find_mode(struct fb_var_screeninfo *var, | |||
539 | namelen = i; | 525 | namelen = i; |
540 | if (!refresh_specified && !bpp_specified && | 526 | if (!refresh_specified && !bpp_specified && |
541 | !yres_specified) { | 527 | !yres_specified) { |
542 | refresh = my_atoi(&name[i+1]); | 528 | refresh = simple_strtol(&name[i+1], NULL, 10); |
543 | refresh_specified = 1; | 529 | refresh_specified = 1; |
544 | if (cvt || rb) | 530 | if (cvt || rb) |
545 | cvt = 0; | 531 | cvt = 0; |
@@ -549,7 +535,7 @@ int fb_find_mode(struct fb_var_screeninfo *var, | |||
549 | case '-': | 535 | case '-': |
550 | namelen = i; | 536 | namelen = i; |
551 | if (!bpp_specified && !yres_specified) { | 537 | if (!bpp_specified && !yres_specified) { |
552 | bpp = my_atoi(&name[i+1]); | 538 | bpp = simple_strtol(&name[i+1], NULL, 10); |
553 | bpp_specified = 1; | 539 | bpp_specified = 1; |
554 | if (cvt || rb) | 540 | if (cvt || rb) |
555 | cvt = 0; | 541 | cvt = 0; |
@@ -558,7 +544,7 @@ int fb_find_mode(struct fb_var_screeninfo *var, | |||
558 | break; | 544 | break; |
559 | case 'x': | 545 | case 'x': |
560 | if (!yres_specified) { | 546 | if (!yres_specified) { |
561 | yres = my_atoi(&name[i+1]); | 547 | yres = simple_strtol(&name[i+1], NULL, 10); |
562 | yres_specified = 1; | 548 | yres_specified = 1; |
563 | } else | 549 | } else |
564 | goto done; | 550 | goto done; |
@@ -586,7 +572,7 @@ int fb_find_mode(struct fb_var_screeninfo *var, | |||
586 | } | 572 | } |
587 | } | 573 | } |
588 | if (i < 0 && yres_specified) { | 574 | if (i < 0 && yres_specified) { |
589 | xres = my_atoi(name); | 575 | xres = simple_strtol(name, NULL, 10); |
590 | res_specified = 1; | 576 | res_specified = 1; |
591 | } | 577 | } |
592 | done: | 578 | done: |