aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorHarald Welte <HaraldWelte@viatech.com>2009-05-12 16:19:42 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-05-12 17:11:35 -0400
commitee1ef82c7e6d073f881952348960bbc639687482 (patch)
tree81e81d6196fb9675cff955d79caf5ed8b7288d9a /drivers
parentee83126bb17f6216e8815a4146e80032b4d80ba4 (diff)
viafb: make it work on x86_64
Fix a bug in viafb on x86_64 builds (e.g. for VIA Nano CPU). You cannot make the assumption that sizeof(unsigned int) == sizeof(unsigned long), so the parsing of the default mode (640x480) fails, leading to a division by zero during insmod of the driver. Signed-off-by: Harald Welte <HaraldWelte@viatech.com> Cc: <JosephChan@via.com.tw> Cc: <ScottFang@viatech.com.cn> Cc: Acked-by: Krzysztof Helt <krzysztof.h1@wp.pl> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/via/viafbdev.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c
index e327b84820d2..a0fec298216e 100644
--- a/drivers/video/via/viafbdev.c
+++ b/drivers/video/via/viafbdev.c
@@ -2103,7 +2103,7 @@ static void viafb_remove_proc(struct proc_dir_entry *viafb_entry)
2103 2103
2104static int __devinit via_pci_probe(void) 2104static int __devinit via_pci_probe(void)
2105{ 2105{
2106 unsigned int default_xres, default_yres; 2106 unsigned long default_xres, default_yres;
2107 char *tmpc, *tmpm; 2107 char *tmpc, *tmpm;
2108 char *tmpc_sec, *tmpm_sec; 2108 char *tmpc_sec, *tmpm_sec;
2109 int vmode_index; 2109 int vmode_index;
@@ -2196,8 +2196,8 @@ static int __devinit via_pci_probe(void)
2196 viafb_FB_MM = viaparinfo->fbmem_virt; 2196 viafb_FB_MM = viaparinfo->fbmem_virt;
2197 tmpm = viafb_mode; 2197 tmpm = viafb_mode;
2198 tmpc = strsep(&tmpm, "x"); 2198 tmpc = strsep(&tmpm, "x");
2199 strict_strtoul(tmpc, 0, (unsigned long *)&default_xres); 2199 strict_strtoul(tmpc, 0, &default_xres);
2200 strict_strtoul(tmpm, 0, (unsigned long *)&default_yres); 2200 strict_strtoul(tmpm, 0, &default_yres);
2201 2201
2202 vmode_index = viafb_get_mode_index(default_xres, default_yres, 0); 2202 vmode_index = viafb_get_mode_index(default_xres, default_yres, 0);
2203 DEBUG_MSG(KERN_INFO "0->index=%d\n", vmode_index); 2203 DEBUG_MSG(KERN_INFO "0->index=%d\n", vmode_index);