提交 6c8f5b90 编写于 作者: D David S. Miller

[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: NDavid S. Miller <davem@davemloft.net>
上级 1bd4b280
...@@ -233,9 +233,9 @@ static u8 bw2regs_66hz[] __devinitdata = { ...@@ -233,9 +233,9 @@ static u8 bw2regs_66hz[] __devinitdata = {
0x10, 0x20, 0 0x10, 0x20, 0
}; };
static void __devinit bw2_do_default_mode(struct bw2_par *par, static int __devinit bw2_do_default_mode(struct bw2_par *par,
struct fb_info *info, struct fb_info *info,
int *linebytes) int *linebytes)
{ {
u8 status, mon; u8 status, mon;
u8 *p; u8 *p;
...@@ -266,17 +266,18 @@ static void __devinit bw2_do_default_mode(struct bw2_par *par, ...@@ -266,17 +266,18 @@ static void __devinit bw2_do_default_mode(struct bw2_par *par,
break; break;
case BWTWO_SR_ID_NOCONN: case BWTWO_SR_ID_NOCONN:
return; return 0;
default: default:
prom_printf("bw2: can't handle SR %02x\n", printk(KERN_ERR "bw2: can't handle SR %02x\n",
status); status);
prom_halt(); return -EINVAL;
} }
for ( ; *p; p += 2) { for ( ; *p; p += 2) {
u8 __iomem *regp = &((u8 __iomem *)par->regs)[p[0]]; u8 __iomem *regp = &((u8 __iomem *)par->regs)[p[0]];
sbus_writeb(p[1], regp); sbus_writeb(p[1], regp);
} }
return 0;
} }
static int __devinit bw2_probe(struct of_device *op, const struct of_device_id *match) static 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,8 +313,11 @@ static int __devinit bw2_probe(struct of_device *op, const struct of_device_id *
if (!par->regs) if (!par->regs)
goto out_release_fb; goto out_release_fb;
if (!of_find_property(dp, "width", NULL)) if (!of_find_property(dp, "width", NULL)) {
bw2_do_default_mode(par, info, &linebytes); err = bw2_do_default_mode(par, info, &linebytes);
if (err)
goto out_unmap_regs;
}
par->fbsize = PAGE_ALIGN(linebytes * info->var.yres); par->fbsize = PAGE_ALIGN(linebytes * info->var.yres);
......
...@@ -315,7 +315,7 @@ static u_char cg3_dacvals[] __devinitdata = { ...@@ -315,7 +315,7 @@ static u_char cg3_dacvals[] __devinitdata = {
4, 0xff, 5, 0x00, 6, 0x70, 7, 0x00, 0 4, 0xff, 5, 0x00, 6, 0x70, 7, 0x00, 0
}; };
static void __devinit cg3_do_default_mode(struct cg3_par *par) static int __devinit cg3_do_default_mode(struct cg3_par *par)
{ {
enum cg3_type type; enum cg3_type type;
u8 *p; u8 *p;
...@@ -332,10 +332,9 @@ static void __devinit cg3_do_default_mode(struct cg3_par *par) ...@@ -332,10 +332,9 @@ static void __devinit cg3_do_default_mode(struct cg3_par *par)
else else
type = CG3_AT_66HZ; type = CG3_AT_66HZ;
} else { } else {
prom_printf("cgthree: can't handle SR %02x\n", printk(KERN_ERR "cgthree: can't handle SR %02x\n",
status); status);
prom_halt(); return -EINVAL;
return;
} }
} }
...@@ -351,6 +350,7 @@ static void __devinit cg3_do_default_mode(struct cg3_par *par) ...@@ -351,6 +350,7 @@ static void __devinit cg3_do_default_mode(struct cg3_par *par)
regp = (u8 __iomem *)&par->regs->cmap.control; regp = (u8 __iomem *)&par->regs->cmap.control;
sbus_writeb(p[1], regp); sbus_writeb(p[1], regp);
} }
return 0;
} }
static int __devinit cg3_probe(struct of_device *op, static int __devinit cg3_probe(struct of_device *op,
...@@ -400,8 +400,11 @@ static int __devinit cg3_probe(struct of_device *op, ...@@ -400,8 +400,11 @@ static int __devinit cg3_probe(struct of_device *op,
cg3_blank(0, info); cg3_blank(0, info);
if (!of_find_property(dp, "width", NULL)) if (!of_find_property(dp, "width", NULL)) {
cg3_do_default_mode(par); err = cg3_do_default_mode(par);
if (err)
goto out_unmap_screen;
}
if (fb_alloc_cmap(&info->cmap, 256, 0)) if (fb_alloc_cmap(&info->cmap, 256, 0))
goto out_unmap_screen; goto out_unmap_screen;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册