patch-2.3.14 linux/drivers/video/imsttfb.c

Next file: linux/drivers/video/macfb.c
Previous file: linux/drivers/video/igafb.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.13/linux/drivers/video/imsttfb.c linux/drivers/video/imsttfb.c
@@ -380,9 +380,7 @@
 #if defined(CONFIG_PPC)
 static signed char init_vmode __initdata = -1, init_cmode __initdata = -1;
 #endif
-#ifdef MODULE
 static struct fb_info_imstt *fb_info_imstt_p[FB_MAX] = { 0, 0, 0, 0, 0, 0, 0, 0 };
-#endif
 
 static struct imstt_regvals tvp_reg_init_2 = {
 	512,
@@ -1853,9 +1851,7 @@
 	printk("fb%u: %s frame buffer; %uMB vram; chip version %u\n",
 		i, p->fix.id, p->total_vram >> 20, tmp);
 
-#ifdef MODULE
 	fb_info_imstt_p[i] = p;
-#endif
 #ifdef CONFIG_FB_COMPAT_XPMAC
 	strncpy(display_info.name, "IMS,tt128mb", sizeof(display_info.name));
 	display_info.fb_address = (__u32)p->frame_buffer_phys;
@@ -1912,9 +1908,10 @@
 }
 #endif
 
-void __init 
+int __init 
 imsttfb_init(void)
 {
+	int i;
 #if defined(CONFIG_FB_OF) && !defined(MODULE)
 	/* We don't want to be called like this. */
 	/* We rely on Open Firmware (offb) instead. */
@@ -1935,13 +1932,13 @@
 			pci_write_config_word(pdev, PCI_COMMAND, cmd);
 		}
 
-		addr = pdev->base_address[0] & PCI_BASE_ADDRESS_MEM_MASK;
+		addr = pdev->resource[0].start;
 		if (!addr)
 			continue;
 
 		p = kmalloc(sizeof(struct fb_info_imstt), GFP_ATOMIC);
 		if (!p)
-			return;
+			continue;
 		memset(p, 0, sizeof(struct fb_info_imstt));
 
 		printk("imsttfb: device=%04x\n", pdev->device);
@@ -1966,16 +1963,21 @@
 		init_imstt(p);
 	}
 #endif /* CONFIG_PCI */
+	for (i = 0; i < FB_MAX; i++) {
+		if (fb_info_imstt_p[i])
+			return 0;
+	}
+	return -ENXIO;
 }
 
 #ifndef MODULE
-void __init 
-imsttfb_setup(char *options, int *ints)
+int __init 
+imsttfb_setup(char *options)
 {
 	char *this_opt;
 
 	if (!options || !*options)
-		return;
+		return 0;
 
 	for (this_opt = strtok(options, ","); this_opt;
 	     this_opt = strtok(NULL, ",")) {
@@ -2020,25 +2022,16 @@
 		}
 #endif
 	}
+	return 0;
 }
 
 #else /* MODULE */
 
-int
+int __init
 init_module (void)
 {
-	struct fb_info_imstt *p;
-	__u32 i;
-
-	imsttfb_init();
 
-	for (i = 0; i < FB_MAX; i++) {
-		p = fb_info_imstt_p[i];
-		if (p)
-			return 0;
-	}
-
-	return -ENXIO;
+	return imsttfb_init();
 }
 
 void

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)