From 6928c18ee5978ed53ea7a70386b3754f8dd0a8b9 Mon Sep 17 00:00:00 2001 From: Aaro Koskinen Date: Tue, 11 Oct 2011 21:47:21 +0300 Subject: staging: xgifb: eliminate XGIfb_mode_no We can get the information from the table with mode index. Signed-off-by: Aaro Koskinen Reviewed-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman diff --git a/drivers/staging/xgifb/XGI_main.h b/drivers/staging/xgifb/XGI_main.h index d423823..ec288a4 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 355a178..7bba394 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, -- cgit v0.10.2