summaryrefslogtreecommitdiff
path: root/drivers/staging/xgifb
diff options
context:
space:
mode:
authorAaro Koskinen <aaro.koskinen@iki.fi>2011-10-11 21:47:21 +0300
committerGreg Kroah-Hartman <gregkh@suse.de>2011-10-12 09:51:46 -0600
commit6928c18ee5978ed53ea7a70386b3754f8dd0a8b9 (patch)
tree5af5e94dca9496ecf7cbc775274a2cbb2f811d83 /drivers/staging/xgifb
parentfcbdda90ef9bedd521c56f0c7529013f03c139e0 (diff)
staging: xgifb: eliminate XGIfb_mode_no
We can get the information from the table with mode index. 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.h1
-rw-r--r--drivers/staging/xgifb/XGI_main_26.c14
2 files changed, 6 insertions, 9 deletions
diff --git a/drivers/staging/xgifb/XGI_main.h b/drivers/staging/xgifb/XGI_main.h
index d423823ca6c6..ec288a41e219 100644
--- a/drivers/staging/xgifb/XGI_main.h
+++ b/drivers/staging/xgifb/XGI_main.h
@@ -354,7 +354,6 @@ static struct _XGIbios_mode {
/* mode-related variables */
static int xgifb_mode_idx = -1;
-static u8 XGIfb_mode_no;
static u8 XGIfb_rate_idx;
/* TW: CR36 evaluation */
diff --git a/drivers/staging/xgifb/XGI_main_26.c b/drivers/staging/xgifb/XGI_main_26.c
index 355a1780fe27..7bba394be5de 100644
--- a/drivers/staging/xgifb/XGI_main_26.c
+++ b/drivers/staging/xgifb/XGI_main_26.c
@@ -402,7 +402,6 @@ static int XGIfb_GetXG21DefaultLVDSModeIdx(void)
&& (XGIbios_mode[XGIfb_mode_idx].yres
== XGI21_LCDCapList[0].LVDSVDE)
&& (XGIbios_mode[XGIfb_mode_idx].bpp == 8)) {
- XGIfb_mode_no = XGIbios_mode[XGIfb_mode_idx].mode_no;
found_mode = 1;
break;
}
@@ -1185,7 +1184,6 @@ static int XGIfb_do_set_var(struct fb_var_screeninfo *var, int isactive,
== var->yres)
&& (XGIbios_mode[xgifb_mode_idx].bpp
== var->bits_per_pixel)) {
- XGIfb_mode_no = XGIbios_mode[xgifb_mode_idx].mode_no;
found_mode = 1;
break;
}
@@ -1214,9 +1212,10 @@ static int XGIfb_do_set_var(struct fb_var_screeninfo *var, int isactive,
if (isactive) {
XGIfb_pre_setmode(xgifb_info);
- if (XGISetModeNew(hw_info, XGIfb_mode_no) == 0) {
+ if (XGISetModeNew(hw_info,
+ XGIbios_mode[xgifb_mode_idx].mode_no) == 0) {
printk(KERN_ERR "XGIfb: Setting mode[0x%x] failed\n",
- XGIfb_mode_no);
+ XGIbios_mode[xgifb_mode_idx].mode_no);
return -EINVAL;
}
info->fix.line_length = ((info->var.xres_virtual
@@ -2287,8 +2286,6 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
}
}
- XGIfb_mode_no = XGIbios_mode[xgifb_mode_idx].mode_no;
-
/* yilin set default refresh rate */
xgifb_info->refresh_rate = refresh_rate;
if (xgifb_info->refresh_rate == 0)
@@ -2351,10 +2348,11 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
default_var.pixclock = (u32) (1000000000 /
XGIfb_mode_rate_to_dclock(&XGI_Pr, hw_info,
- XGIfb_mode_no, XGIfb_rate_idx));
+ XGIbios_mode[xgifb_mode_idx].mode_no,
+ XGIfb_rate_idx));
if (XGIfb_mode_rate_to_ddata(&XGI_Pr, hw_info,
- XGIfb_mode_no, XGIfb_rate_idx,
+ XGIbios_mode[xgifb_mode_idx].mode_no, XGIfb_rate_idx,
&default_var.left_margin, &default_var.right_margin,
&default_var.upper_margin, &default_var.lower_margin,
&default_var.hsync_len, &default_var.vsync_len,