diff -ur -x .depend -x *.o -x *.flags /linux.vanilla/drivers/video/tgafb.c /linux//drivers/video/tgafb.c --- /linux.vanilla/drivers/video/tgafb.c Tue Mar 27 20:32:57 2001 +++ /linux//drivers/video/tgafb.c Thu Mar 29 22:01:09 2001 @@ -57,14 +57,14 @@ static struct tgafb_info fb_info; static struct tgafb_par current_par; -static int current_par_valid = 0; +static int current_par_valid; static struct display disp; static char default_fontname[40] __initdata = { 0 }; static struct fb_var_screeninfo default_var; -static int default_var_valid = 0; +static int default_var_valid; -static int currcon = 0; +static int currcon; static struct { u_char red, green, blue, pad; } palette[256]; #ifdef FBCON_HAS_CFB32 @@ -778,7 +778,7 @@ static int tgafb_blank(int blank, struct fb_info_gen *info) { - static int tga_vesa_blanked = 0; + static int tga_vesa_blanked; u32 vhcr, vvcr, vvvr; unsigned long flags; @@ -921,14 +921,20 @@ int __init tgafb_init(void) { struct pci_dev *pdev; + int retval; pdev = pci_find_device(PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_TGA, NULL); if (!pdev) return -ENXIO; + if ((retval = pci_enable_device(pdev))) + return retval; + /* divine board type */ - fb_info.tga_mem_base = (unsigned long)ioremap(pdev->resource[0].start, 0); + fb_info.tga_mem_base = (unsigned long)ioremap(pci_resource_start(pdev, 0), 0); + if (!fb_info.tga_mem_base) + return -ENOMEM; fb_info.tga_type = (readl(fb_info.tga_mem_base) >> 12) & 0x0f; fb_info.tga_regs_base = fb_info.tga_mem_base + TGA_REGS_OFFSET; fb_info.tga_fb_base = (fb_info.tga_mem_base @@ -979,11 +985,11 @@ fbgen_do_set_var(&disp.var, 1, &fb_info.gen); fbgen_set_disp(-1, &fb_info.gen); fbgen_install_cmap(0, &fb_info.gen); - if (register_framebuffer(&fb_info.gen.info) < 0) - return -EINVAL; + if ((retval = register_framebuffer(&fb_info.gen.info))) + return retval; printk(KERN_INFO "fb%d: %s frame buffer device at 0x%lx\n", GET_FB_IDX(fb_info.gen.info.node), fb_info.gen.info.modename, - pdev->resource[0].start); + pci_resource_start(pdev, 0)); return 0; } @@ -994,6 +1000,7 @@ void __exit tgafb_cleanup(void) { + iounmap((void *)fb_info.tga_mem_base); unregister_framebuffer(&fb_info.gen.info); }