diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /drivers/video/modedb.c | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/video/modedb.c')
-rw-r--r-- | drivers/video/modedb.c | 33 |
1 files changed, 10 insertions, 23 deletions
diff --git a/drivers/video/modedb.c b/drivers/video/modedb.c index 34e4e7995169..0a4dbdc1693a 100644 --- a/drivers/video/modedb.c +++ b/drivers/video/modedb.c | |||
@@ -12,7 +12,9 @@ | |||
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include <linux/module.h> | 14 | #include <linux/module.h> |
15 | #include <linux/slab.h> | ||
15 | #include <linux/fb.h> | 16 | #include <linux/fb.h> |
17 | #include <linux/kernel.h> | ||
16 | 18 | ||
17 | #undef DEBUG | 19 | #undef DEBUG |
18 | 20 | ||
@@ -402,21 +404,6 @@ const struct fb_videomode vesa_modes[] = { | |||
402 | EXPORT_SYMBOL(vesa_modes); | 404 | EXPORT_SYMBOL(vesa_modes); |
403 | #endif /* CONFIG_FB_MODE_HELPERS */ | 405 | #endif /* CONFIG_FB_MODE_HELPERS */ |
404 | 406 | ||
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 | /** | 407 | /** |
421 | * fb_try_mode - test a video mode | 408 | * fb_try_mode - test a video mode |
422 | * @var: frame buffer user defined part of display | 409 | * @var: frame buffer user defined part of display |
@@ -539,7 +526,7 @@ int fb_find_mode(struct fb_var_screeninfo *var, | |||
539 | namelen = i; | 526 | namelen = i; |
540 | if (!refresh_specified && !bpp_specified && | 527 | if (!refresh_specified && !bpp_specified && |
541 | !yres_specified) { | 528 | !yres_specified) { |
542 | refresh = my_atoi(&name[i+1]); | 529 | refresh = simple_strtol(&name[i+1], NULL, 10); |
543 | refresh_specified = 1; | 530 | refresh_specified = 1; |
544 | if (cvt || rb) | 531 | if (cvt || rb) |
545 | cvt = 0; | 532 | cvt = 0; |
@@ -549,7 +536,7 @@ int fb_find_mode(struct fb_var_screeninfo *var, | |||
549 | case '-': | 536 | case '-': |
550 | namelen = i; | 537 | namelen = i; |
551 | if (!bpp_specified && !yres_specified) { | 538 | if (!bpp_specified && !yres_specified) { |
552 | bpp = my_atoi(&name[i+1]); | 539 | bpp = simple_strtol(&name[i+1], NULL, 10); |
553 | bpp_specified = 1; | 540 | bpp_specified = 1; |
554 | if (cvt || rb) | 541 | if (cvt || rb) |
555 | cvt = 0; | 542 | cvt = 0; |
@@ -558,7 +545,7 @@ int fb_find_mode(struct fb_var_screeninfo *var, | |||
558 | break; | 545 | break; |
559 | case 'x': | 546 | case 'x': |
560 | if (!yres_specified) { | 547 | if (!yres_specified) { |
561 | yres = my_atoi(&name[i+1]); | 548 | yres = simple_strtol(&name[i+1], NULL, 10); |
562 | yres_specified = 1; | 549 | yres_specified = 1; |
563 | } else | 550 | } else |
564 | goto done; | 551 | goto done; |
@@ -586,7 +573,7 @@ int fb_find_mode(struct fb_var_screeninfo *var, | |||
586 | } | 573 | } |
587 | } | 574 | } |
588 | if (i < 0 && yres_specified) { | 575 | if (i < 0 && yres_specified) { |
589 | xres = my_atoi(name); | 576 | xres = simple_strtol(name, NULL, 10); |
590 | res_specified = 1; | 577 | res_specified = 1; |
591 | } | 578 | } |
592 | done: | 579 | done: |
@@ -907,7 +894,7 @@ const struct fb_videomode *fb_match_mode(const struct fb_var_screeninfo *var, | |||
907 | } | 894 | } |
908 | 895 | ||
909 | /** | 896 | /** |
910 | * fb_add_videomode: adds videomode entry to modelist | 897 | * fb_add_videomode - adds videomode entry to modelist |
911 | * @mode: videomode to add | 898 | * @mode: videomode to add |
912 | * @head: struct list_head of modelist | 899 | * @head: struct list_head of modelist |
913 | * | 900 | * |
@@ -942,7 +929,7 @@ int fb_add_videomode(const struct fb_videomode *mode, struct list_head *head) | |||
942 | } | 929 | } |
943 | 930 | ||
944 | /** | 931 | /** |
945 | * fb_delete_videomode: removed videomode entry from modelist | 932 | * fb_delete_videomode - removed videomode entry from modelist |
946 | * @mode: videomode to remove | 933 | * @mode: videomode to remove |
947 | * @head: struct list_head of modelist | 934 | * @head: struct list_head of modelist |
948 | * | 935 | * |
@@ -967,7 +954,7 @@ void fb_delete_videomode(const struct fb_videomode *mode, | |||
967 | } | 954 | } |
968 | 955 | ||
969 | /** | 956 | /** |
970 | * fb_destroy_modelist: destroy modelist | 957 | * fb_destroy_modelist - destroy modelist |
971 | * @head: struct list_head of modelist | 958 | * @head: struct list_head of modelist |
972 | */ | 959 | */ |
973 | void fb_destroy_modelist(struct list_head *head) | 960 | void fb_destroy_modelist(struct list_head *head) |
@@ -982,7 +969,7 @@ void fb_destroy_modelist(struct list_head *head) | |||
982 | EXPORT_SYMBOL_GPL(fb_destroy_modelist); | 969 | EXPORT_SYMBOL_GPL(fb_destroy_modelist); |
983 | 970 | ||
984 | /** | 971 | /** |
985 | * fb_videomode_to_modelist: convert mode array to mode list | 972 | * fb_videomode_to_modelist - convert mode array to mode list |
986 | * @modedb: array of struct fb_videomode | 973 | * @modedb: array of struct fb_videomode |
987 | * @num: number of entries in array | 974 | * @num: number of entries in array |
988 | * @head: struct list_head of modelist | 975 | * @head: struct list_head of modelist |