summaryrefslogtreecommitdiffstats
path: root/drivers/staging/xgifb/XGI_main_26.c
diff options
context:
space:
mode:
authorAaro Koskinen2011-08-29 22:14:29 +0200
committerGreg Kroah-Hartman2011-09-06 20:41:24 +0200
commitde736dbb2253679806a281f125983f58d1ae1218 (patch)
treec164cab21d9969234d0b653db6f33cf1238d0782 /drivers/staging/xgifb/XGI_main_26.c
parentstaging: xgifb: delete duplicated default video mode setup code (diff)
downloadkernel-qcow2-linux-de736dbb2253679806a281f125983f58d1ae1218.tar.gz
kernel-qcow2-linux-de736dbb2253679806a281f125983f58d1ae1218.tar.xz
kernel-qcow2-linux-de736dbb2253679806a281f125983f58d1ae1218.zip
staging: xgifb: fail the probe if no supported LCD video mode found
Fail the probe if the LCD resolution described in card firmware does not match any of the supported modes. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/xgifb/XGI_main_26.c')
-rw-r--r--drivers/staging/xgifb/XGI_main_26.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/staging/xgifb/XGI_main_26.c b/drivers/staging/xgifb/XGI_main_26.c
index 34678a3b0fc2..e989eb4e5163 100644
--- a/drivers/staging/xgifb/XGI_main_26.c
+++ b/drivers/staging/xgifb/XGI_main_26.c
@@ -449,7 +449,7 @@ static int XGIfb_GetXG21DefaultLVDSModeIdx(void)
XGIfb_mode_idx++;
}
if (!found_mode)
- XGIfb_mode_idx = 0;
+ XGIfb_mode_idx = -1;
return XGIfb_mode_idx;
}
@@ -2313,6 +2313,11 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
}
}
+ if (xgifb_mode_idx < 0) {
+ dev_err(&pdev->dev, "no supported video mode found\n");
+ goto error_1;
+ }
+
if (xgi21_drvlcdcaplist) {
int m;