aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2007-08-25 01:33:15 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-08-26 21:49:08 -0400
commit6c8f5b90bfbe69a27763fb0e181bd2465181446d (patch)
treebb62f00ccd9ab1472446831f9e1442ad6bb86f47 /drivers/video
parent1bd4b280394cdd14f82efc00808c6d77b097285a (diff)
[VIDEO]: Do not prom_halt() in cg3 and bw2 device probe.
Just give a normal kernel log message of the problem and return failure. Based upon a patch from Mark Fortescue. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/bw2.c22
-rw-r--r--drivers/video/cg3.c17
2 files changed, 23 insertions, 16 deletions
diff --git a/drivers/video/bw2.c b/drivers/video/bw2.c
index 718b9f83736e..833b10c84064 100644
--- a/drivers/video/bw2.c
+++ b/drivers/video/bw2.c
@@ -233,9 +233,9 @@ static u8 bw2regs_66hz[] __devinitdata = {
233 0x10, 0x20, 0 233 0x10, 0x20, 0
234}; 234};
235 235
236static void __devinit bw2_do_default_mode(struct bw2_par *par, 236static int __devinit bw2_do_default_mode(struct bw2_par *par,
237 struct fb_info *info, 237 struct fb_info *info,
238 int *linebytes) 238 int *linebytes)
239{ 239{
240 u8 status, mon; 240 u8 status, mon;
241 u8 *p; 241 u8 *p;
@@ -266,17 +266,18 @@ static void __devinit bw2_do_default_mode(struct bw2_par *par,
266 break; 266 break;
267 267
268 case BWTWO_SR_ID_NOCONN: 268 case BWTWO_SR_ID_NOCONN:
269 return; 269 return 0;
270 270
271 default: 271 default:
272 prom_printf("bw2: can't handle SR %02x\n", 272 printk(KERN_ERR "bw2: can't handle SR %02x\n",
273 status); 273 status);
274 prom_halt(); 274 return -EINVAL;
275 } 275 }
276 for ( ; *p; p += 2) { 276 for ( ; *p; p += 2) {
277 u8 __iomem *regp = &((u8 __iomem *)par->regs)[p[0]]; 277 u8 __iomem *regp = &((u8 __iomem *)par->regs)[p[0]];
278 sbus_writeb(p[1], regp); 278 sbus_writeb(p[1], regp);
279 } 279 }
280 return 0;
280} 281}
281 282
282static int __devinit bw2_probe(struct of_device *op, const struct of_device_id *match) 283static int __devinit bw2_probe(struct of_device *op, const struct of_device_id *match)
@@ -312,8 +313,11 @@ static int __devinit bw2_probe(struct of_device *op, const struct of_device_id *
312 if (!par->regs) 313 if (!par->regs)
313 goto out_release_fb; 314 goto out_release_fb;
314 315
315 if (!of_find_property(dp, "width", NULL)) 316 if (!of_find_property(dp, "width", NULL)) {
316 bw2_do_default_mode(par, info, &linebytes); 317 err = bw2_do_default_mode(par, info, &linebytes);
318 if (err)
319 goto out_unmap_regs;
320 }
317 321
318 par->fbsize = PAGE_ALIGN(linebytes * info->var.yres); 322 par->fbsize = PAGE_ALIGN(linebytes * info->var.yres);
319 323
diff --git a/drivers/video/cg3.c b/drivers/video/cg3.c
index 5741b46ade1b..a5c7fb331527 100644
--- a/drivers/video/cg3.c
+++ b/drivers/video/cg3.c
@@ -315,7 +315,7 @@ static u_char cg3_dacvals[] __devinitdata = {
315 4, 0xff, 5, 0x00, 6, 0x70, 7, 0x00, 0 315 4, 0xff, 5, 0x00, 6, 0x70, 7, 0x00, 0
316}; 316};
317 317
318static void __devinit cg3_do_default_mode(struct cg3_par *par) 318static int __devinit cg3_do_default_mode(struct cg3_par *par)
319{ 319{
320 enum cg3_type type; 320 enum cg3_type type;
321 u8 *p; 321 u8 *p;
@@ -332,10 +332,9 @@ static void __devinit cg3_do_default_mode(struct cg3_par *par)
332 else 332 else
333 type = CG3_AT_66HZ; 333 type = CG3_AT_66HZ;
334 } else { 334 } else {
335 prom_printf("cgthree: can't handle SR %02x\n", 335 printk(KERN_ERR "cgthree: can't handle SR %02x\n",
336 status); 336 status);
337 prom_halt(); 337 return -EINVAL;
338 return;
339 } 338 }
340 } 339 }
341 340
@@ -351,6 +350,7 @@ static void __devinit cg3_do_default_mode(struct cg3_par *par)
351 regp = (u8 __iomem *)&par->regs->cmap.control; 350 regp = (u8 __iomem *)&par->regs->cmap.control;
352 sbus_writeb(p[1], regp); 351 sbus_writeb(p[1], regp);
353 } 352 }
353 return 0;
354} 354}
355 355
356static int __devinit cg3_probe(struct of_device *op, 356static int __devinit cg3_probe(struct of_device *op,
@@ -400,8 +400,11 @@ static int __devinit cg3_probe(struct of_device *op,
400 400
401 cg3_blank(0, info); 401 cg3_blank(0, info);
402 402
403 if (!of_find_property(dp, "width", NULL)) 403 if (!of_find_property(dp, "width", NULL)) {
404 cg3_do_default_mode(par); 404 err = cg3_do_default_mode(par);
405 if (err)
406 goto out_unmap_screen;
407 }
405 408
406 if (fb_alloc_cmap(&info->cmap, 256, 0)) 409 if (fb_alloc_cmap(&info->cmap, 256, 0))
407 goto out_unmap_screen; 410 goto out_unmap_screen;