Skip to content

Commit

Permalink
[PATCH] Detaching fbcon: remove calls to pci_disable_device()
Browse files Browse the repository at this point in the history
Detaching fbcon allows individual drivers to be unloaded.  However several
drivers call pci_disable_device() upon exit.  This function will disable the
BAR's which will kill VGA text mode and/or affect X/DRM.

To prevent this, remove calls to pci_disable_device() from several drivers.

Signed-off-by: Antonino Daplas <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Antonino A. Daplas authored and Linus Torvalds committed Jun 26, 2006
1 parent 1c8ce27 commit a06630f
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 20 deletions.
2 changes: 0 additions & 2 deletions drivers/video/aty/radeon_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -2379,7 +2379,6 @@ static int __devinit radeonfb_pci_register (struct pci_dev *pdev,
err_release_fb:
framebuffer_release(info);
err_disable:
pci_disable_device(pdev);
err_out:
return ret;
}
Expand Down Expand Up @@ -2436,7 +2435,6 @@ static void __devexit radeonfb_pci_unregister (struct pci_dev *pdev)
#endif
fb_dealloc_cmap(&info->cmap);
framebuffer_release(info);
pci_disable_device(pdev);
}


Expand Down
2 changes: 0 additions & 2 deletions drivers/video/cirrusfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -2227,7 +2227,6 @@ static void cirrusfb_pci_unmap (struct cirrusfb_info *cinfo)
release_region(0x3C0, 32);
pci_release_regions(pdev);
framebuffer_release(cinfo->info);
pci_disable_device(pdev);
}
#endif /* CONFIG_PCI */

Expand Down Expand Up @@ -2458,7 +2457,6 @@ static int cirrusfb_pci_register (struct pci_dev *pdev,
err_release_fb:
framebuffer_release(info);
err_disable:
pci_disable_device(pdev);
err_out:
return ret;
}
Expand Down
3 changes: 0 additions & 3 deletions drivers/video/geode/gx1fb_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,6 @@ static int __init gx1fb_probe(struct pci_dev *pdev, const struct pci_device_id *
release_mem_region(gx1_gx_base() + 0x8300, 0x100);
}

pci_disable_device(pdev);

if (info)
framebuffer_release(info);
return ret;
Expand All @@ -399,7 +397,6 @@ static void gx1fb_remove(struct pci_dev *pdev)
iounmap(par->dc_regs);
release_mem_region(gx1_gx_base() + 0x8300, 0x100);

pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);

framebuffer_release(info);
Expand Down
3 changes: 0 additions & 3 deletions drivers/video/geode/gxfb_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,6 @@ static int __init gxfb_probe(struct pci_dev *pdev, const struct pci_device_id *i
pci_release_region(pdev, 2);
}

pci_disable_device(pdev);

if (info)
framebuffer_release(info);
return ret;
Expand All @@ -377,7 +375,6 @@ static void gxfb_remove(struct pci_dev *pdev)
iounmap(par->dc_regs);
pci_release_region(pdev, 2);

pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);

framebuffer_release(info);
Expand Down
3 changes: 0 additions & 3 deletions drivers/video/i810/i810_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2110,9 +2110,6 @@ static void i810fb_release_resource(struct fb_info *info,
if (par->res_flags & MMIO_REQ)
release_mem_region(par->mmio_start_phys, MMIO_SIZE);

if (par->res_flags & PCI_DEVICE_ENABLED)
pci_disable_device(par->dev);

framebuffer_release(info);

}
Expand Down
7 changes: 2 additions & 5 deletions drivers/video/nvidia/nvidia.c
Original file line number Diff line number Diff line change
Expand Up @@ -1219,7 +1219,7 @@ static int __devinit nvidiafb_probe(struct pci_dev *pd,

if (pci_request_regions(pd, "nvidiafb")) {
printk(KERN_ERR PFX "cannot request PCI regions\n");
goto err_out_request;
goto err_out_enable;
}

par->FlatPanel = flatpanel;
Expand Down Expand Up @@ -1338,10 +1338,8 @@ static int __devinit nvidiafb_probe(struct pci_dev *pd,
nvidia_delete_i2c_busses(par);
err_out_arch:
iounmap(par->REGS);
err_out_free_base0:
err_out_free_base0:
pci_release_regions(pd);
err_out_request:
pci_disable_device(pd);
err_out_enable:
kfree(info->pixmap.addr);
err_out_kfree:
Expand Down Expand Up @@ -1371,7 +1369,6 @@ static void __exit nvidiafb_remove(struct pci_dev *pd)
nvidia_delete_i2c_busses(par);
iounmap(par->REGS);
pci_release_regions(pd);
pci_disable_device(pd);
kfree(info->pixmap.addr);
framebuffer_release(info);
pci_set_drvdata(pd, NULL);
Expand Down
2 changes: 0 additions & 2 deletions drivers/video/riva/fbdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -2152,7 +2152,6 @@ static int __devinit rivafb_probe(struct pci_dev *pd,
err_release_region:
pci_release_regions(pd);
err_disable_device:
pci_disable_device(pd);
err_free_pixmap:
kfree(info->pixmap.addr);
err_framebuffer_release:
Expand Down Expand Up @@ -2187,7 +2186,6 @@ static void __exit rivafb_remove(struct pci_dev *pd)
if (par->riva.Architecture == NV_ARCH_03)
iounmap(par->riva.PRAMIN);
pci_release_regions(pd);
pci_disable_device(pd);
kfree(info->pixmap.addr);
framebuffer_release(info);
pci_set_drvdata(pd, NULL);
Expand Down

0 comments on commit a06630f

Please sign in to comment.