aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/modedb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/modedb.c')
-rw-r--r--drivers/video/modedb.c24
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[] = {
402EXPORT_SYMBOL(vesa_modes); 403EXPORT_SYMBOL(vesa_modes);
403#endif /* CONFIG_FB_MODE_HELPERS */ 404#endif /* CONFIG_FB_MODE_HELPERS */
404 405
405static 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 }
592done: 578done: