diff options
author | Aaro Koskinen <aaro.koskinen@iki.fi> | 2011-10-11 21:47:30 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-10-12 09:51:48 -0600 |
commit | f2df8c097a3cf0436c22358e11033c2d3b320aa4 (patch) | |
tree | 7cd2e96576637e611a2d281089dddf26de386e96 /drivers/staging/xgifb | |
parent | 7d2ab0c62dd3eb283853340e8aab095bdb6f6ac7 (diff) |
staging: xgifb: eliminate global XGI_Pr data
Move vb_device_info into xgifb_video_info.
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>
Diffstat (limited to 'drivers/staging/xgifb')
-rw-r--r-- | drivers/staging/xgifb/XGI_main.h | 21 | ||||
-rw-r--r-- | drivers/staging/xgifb/XGI_main_26.c | 15 | ||||
-rw-r--r-- | drivers/staging/xgifb/XGIfb.h | 2 |
3 files changed, 21 insertions, 17 deletions
diff --git a/drivers/staging/xgifb/XGI_main.h b/drivers/staging/xgifb/XGI_main.h index 6c1f5e0a1bfc..731262adee9d 100644 --- a/drivers/staging/xgifb/XGI_main.h +++ b/drivers/staging/xgifb/XGI_main.h @@ -52,15 +52,15 @@ MODULE_DEVICE_TABLE(pci, xgifb_pci_table); #define SEQ_DATA 0x15 -#define XGISR XGI_Pr.P3c4 -#define XGICR XGI_Pr.P3d4 -#define XGIDACA XGI_Pr.P3c8 -#define XGIDACD XGI_Pr.P3c9 -#define XGIPART1 XGI_Pr.Part1Port -#define XGIPART2 XGI_Pr.Part2Port -#define XGIPART3 XGI_Pr.Part3Port -#define XGIPART4 XGI_Pr.Part4Port -#define XGIPART5 XGI_Pr.Part5Port +#define XGISR (xgifb_info->dev_info.P3c4) +#define XGICR (xgifb_info->dev_info.P3d4) +#define XGIDACA (xgifb_info->dev_info.P3c8) +#define XGIDACD (xgifb_info->dev_info.P3c9) +#define XGIPART1 (xgifb_info->dev_info.Part1Port) +#define XGIPART2 (xgifb_info->dev_info.Part2Port) +#define XGIPART3 (xgifb_info->dev_info.Part3Port) +#define XGIPART4 (xgifb_info->dev_info.Part4Port) +#define XGIPART5 (xgifb_info->dev_info.Part5Port) #define XGIDAC2A XGIPART5 #define XGIDAC2D (XGIPART5 + 1) @@ -143,9 +143,6 @@ static int XGIfb_tvplug = -1; /* TW: For ioctl XGIFB_GET_INFO */ /* XGIfb_info XGIfbinfo; */ -/* TW: XGI private structure */ -static struct vb_device_info XGI_Pr; - #define MD_XGI300 1 #define MD_XGI315 2 diff --git a/drivers/staging/xgifb/XGI_main_26.c b/drivers/staging/xgifb/XGI_main_26.c index bbbcdb7e50e3..dc6a9a8faf78 100644 --- a/drivers/staging/xgifb/XGI_main_26.c +++ b/drivers/staging/xgifb/XGI_main_26.c @@ -1650,6 +1650,7 @@ static int XGIfb_pan_display(struct fb_var_screeninfo *var, static int XGIfb_blank(int blank, struct fb_info *info) { + struct xgifb_video_info *xgifb_info = info->par; u8 reg; reg = xgifb_reg_get(XGICR, 0x17); @@ -2002,14 +2003,15 @@ static int __devinit xgifb_probe(struct pci_dev *pdev, hw_info->pjIOAddress = (unsigned char *)xgifb_info->vga_base; /* XGI_Pr.RelIO = ioremap(pci_resource_start(pdev, 2), 128) + 0x30; */ printk("XGIfb: Relocate IO address: %lx [%08lx]\n", - (unsigned long)pci_resource_start(pdev, 2), XGI_Pr.RelIO); + (unsigned long)pci_resource_start(pdev, 2), + xgifb_info->dev_info.RelIO); if (pci_enable_device(pdev)) { ret = -EIO; goto error; } - XGIRegInit(&XGI_Pr, (unsigned long)hw_info->pjIOAddress); + XGIRegInit(&xgifb_info->dev_info, (unsigned long)hw_info->pjIOAddress); xgifb_reg_set(XGISR, IND_XGI_PASSWORD, XGI_PASSWORD); reg1 = xgifb_reg_get(XGISR, IND_XGI_PASSWORD); @@ -2292,7 +2294,9 @@ static int __devinit xgifb_probe(struct pci_dev *pdev, XGIbios_mode[xgifb_info->mode_idx].xres) && (XGI21_LCDCapList[m].LVDSVDE == XGIbios_mode[xgifb_info->mode_idx].yres)) { - xgifb_reg_set(XGI_Pr.P3d4, 0x36, m); + xgifb_reg_set(xgifb_info->dev_info.P3d4, + 0x36, + m); break; } } @@ -2364,11 +2368,12 @@ static int __devinit xgifb_probe(struct pci_dev *pdev, XGIfb_bpp_to_var(xgifb_info, &fb_info->var); fb_info->var.pixclock = (u32) (1000000000 / - XGIfb_mode_rate_to_dclock(&XGI_Pr, hw_info, + XGIfb_mode_rate_to_dclock(&xgifb_info->dev_info, + hw_info, XGIbios_mode[xgifb_info->mode_idx].mode_no, xgifb_info->rate_idx)); - if (XGIfb_mode_rate_to_ddata(&XGI_Pr, hw_info, + if (XGIfb_mode_rate_to_ddata(&xgifb_info->dev_info, hw_info, XGIbios_mode[xgifb_info->mode_idx].mode_no, xgifb_info->rate_idx, &fb_info->var.left_margin, diff --git a/drivers/staging/xgifb/XGIfb.h b/drivers/staging/xgifb/XGIfb.h index efcfac865001..7d2b970991b5 100644 --- a/drivers/staging/xgifb/XGIfb.h +++ b/drivers/staging/xgifb/XGIfb.h @@ -3,6 +3,7 @@ #include <linux/ioctl.h> #include <linux/types.h> +#include "vb_struct.h" #include "vgatypes.h" #define DISPTYPE_CRT1 0x00000008L @@ -57,6 +58,7 @@ enum xgi_tv_plug { /* vicki@030226 */ struct xgifb_video_info { struct fb_info *fb_info; struct xgi_hw_device_info hw_info; + struct vb_device_info dev_info; int mode_idx; int rate_idx; |