From: Aaro Koskinen Date: Mon, 29 Aug 2011 20:14:30 +0000 (+0300) Subject: staging: xgifb: simplify default mode setup X-Git-Tag: MMI-PSA29.97-13-9~18234^2^2~797 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c8bec1f067b08a7a3baa66e6d8ab98aeda7df8d2;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git staging: xgifb: simplify default mode setup The default mode is the same regardless of the display type, except for XG21/LCD which is determined dynamically. Signed-off-by: Aaro Koskinen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/xgifb/XGI_main.h b/drivers/staging/xgifb/XGI_main.h index 409b5150dcc7..35b1e9f8c2e2 100644 --- a/drivers/staging/xgifb/XGI_main.h +++ b/drivers/staging/xgifb/XGI_main.h @@ -254,8 +254,6 @@ static struct _XGIbios_mode { {"800x480x32", 0x76, 0x0000, 0x0000, 800, 480, 32, 1, 100, 30, MD_XGI300|MD_XGI315}, #define DEFAULT_MODE 21 /* TW: index for 800x600x8 */ -#define DEFAULT_LCDMODE 21 /* TW: index for 800x600x8 */ -#define DEFAULT_TVMODE 21 /* TW: index for 800x600x8 */ {"800x600x8", 0x30, 0x0103, 0x0103, 800, 600, 8, 1, 100, 37, MD_XGI300|MD_XGI315}, {"800x600x16", 0x47, 0x0114, 0x0114, 800, 600, 16, 1, 100, 37, diff --git a/drivers/staging/xgifb/XGI_main_26.c b/drivers/staging/xgifb/XGI_main_26.c index e989eb4e5163..ff0392bb0297 100644 --- a/drivers/staging/xgifb/XGI_main_26.c +++ b/drivers/staging/xgifb/XGI_main_26.c @@ -2297,20 +2297,12 @@ static int __devinit xgifb_probe(struct pci_dev *pdev, xgifb_mode_idx = XGIfb_validate_mode(xgifb_mode_idx); if (xgifb_mode_idx < 0) { - switch (xgi_video_info.disp_state & DISPTYPE_DISP2) { - case DISPTYPE_LCD: - xgifb_mode_idx = DEFAULT_LCDMODE; - if (xgi_video_info.chip == XG21) - xgifb_mode_idx = - XGIfb_GetXG21DefaultLVDSModeIdx(); - break; - case DISPTYPE_TV: - xgifb_mode_idx = DEFAULT_TVMODE; - break; - default: + if ((xgi_video_info.disp_state & DISPTYPE_DISP2) == + DISPTYPE_LCD && + xgi_video_info.chip == XG21) + xgifb_mode_idx = XGIfb_GetXG21DefaultLVDSModeIdx(); + else xgifb_mode_idx = DEFAULT_MODE; - break; - } } if (xgifb_mode_idx < 0) {