summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaro Koskinen <aaro.koskinen@iki.fi>2011-10-11 18:47:13 (GMT)
committerGreg Kroah-Hartman <gregkh@suse.de>2011-10-12 15:51:44 (GMT)
commit54301b5cfe3c16002ab25762a8cd2186beee4a75 (patch)
treea4ed93c1824bccc5a67132f3b4d8b61e0edca3e9
parent3d65c85f9187d311dbf1bf9e7fc2f5091a770853 (diff)
downloadlinux-fsl-qoriq-54301b5cfe3c16002ab25762a8cd2186beee4a75.tar.xz
staging: xgifb: use PCI drvdata
Don't access the global xgi_video_info directly in xgifb_remove(). Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/staging/xgifb/XGI_main_26.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/staging/xgifb/XGI_main_26.c b/drivers/staging/xgifb/XGI_main_26.c
index e6156f1..6957b65 100644
--- a/drivers/staging/xgifb/XGI_main_26.c
+++ b/drivers/staging/xgifb/XGI_main_26.c
@@ -2415,6 +2415,8 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
goto error_mtrr;
}
+ pci_set_drvdata(pdev, &xgi_video_info);
+
dumpVGAReg();
return 0;
@@ -2444,17 +2446,18 @@ error:
static void __devexit xgifb_remove(struct pci_dev *pdev)
{
+ struct video_info *xgifb_info = pci_get_drvdata(pdev);
+
unregister_framebuffer(fb_info);
#ifdef CONFIG_MTRR
- if (xgi_video_info.mtrr >= 0)
- mtrr_del(xgi_video_info.mtrr, xgi_video_info.video_base,
- xgi_video_info.video_size);
+ if (xgifb_info->mtrr >= 0)
+ mtrr_del(xgifb_info->mtrr, xgifb_info->video_base,
+ xgifb_info->video_size);
#endif /* CONFIG_MTRR */
- iounmap(xgi_video_info.mmio_vbase);
- iounmap(xgi_video_info.video_vbase);
- release_mem_region(xgi_video_info.mmio_base, xgi_video_info.mmio_size);
- release_mem_region(xgi_video_info.video_base,
- xgi_video_info.video_size);
+ iounmap(xgifb_info->mmio_vbase);
+ iounmap(xgifb_info->video_vbase);
+ release_mem_region(xgifb_info->mmio_base, xgifb_info->mmio_size);
+ release_mem_region(xgifb_info->video_base, xgifb_info->video_size);
vfree(XGIhw_ext.pjVirtualRomBase);
framebuffer_release(fb_info);
pci_set_drvdata(pdev, NULL);