X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=drivers%2Fvideo%2Fcg3.c;h=3aa7b6cb0268591283b72f77425344be184d1420;hb=51558576ead54c1047e4d41440626e4f9aa015ea;hp=5741b46ade1be0b0780d07a79f8e02cd41de98be;hpb=c7f439b99efbea74c70a5531f92566db5a6731f2;p=~andy%2Flinux diff --git a/drivers/video/cg3.c b/drivers/video/cg3.c index 5741b46ade1..3aa7b6cb026 100644 --- a/drivers/video/cg3.c +++ b/drivers/video/cg3.c @@ -17,11 +17,9 @@ #include #include #include +#include #include -#include -#include -#include #include #include "sbuslib.h" @@ -315,7 +313,7 @@ static u_char cg3_dacvals[] __devinitdata = { 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; u8 *p; @@ -332,10 +330,9 @@ static void __devinit cg3_do_default_mode(struct cg3_par *par) else type = CG3_AT_66HZ; } else { - prom_printf("cgthree: can't handle SR %02x\n", - status); - prom_halt(); - return; + printk(KERN_ERR "cgthree: can't handle SR %02x\n", + status); + return -EINVAL; } } @@ -351,6 +348,7 @@ static void __devinit cg3_do_default_mode(struct cg3_par *par) regp = (u8 __iomem *)&par->regs->cmap.control; sbus_writeb(p[1], regp); } + return 0; } static int __devinit cg3_probe(struct of_device *op, @@ -373,7 +371,7 @@ static int __devinit cg3_probe(struct of_device *op, par->physbase = op->resource[0].start; par->which_io = op->resource[0].flags & IORESOURCE_BITS; - sbusfb_fill_var(&info->var, dp->node, 8); + sbusfb_fill_var(&info->var, dp, 8); info->var.red.length = 8; info->var.green.length = 8; info->var.blue.length = 8; @@ -398,10 +396,13 @@ static int __devinit cg3_probe(struct of_device *op, if (!info->screen_base) goto out_unmap_regs; - cg3_blank(0, info); + cg3_blank(FB_BLANK_UNBLANK, info); - if (!of_find_property(dp, "width", NULL)) - cg3_do_default_mode(par); + if (!of_find_property(dp, "width", NULL)) { + err = cg3_do_default_mode(par); + if (err) + goto out_unmap_screen; + } if (fb_alloc_cmap(&info->cmap, 256, 0)) goto out_unmap_screen; @@ -416,7 +417,7 @@ static int __devinit cg3_probe(struct of_device *op, dev_set_drvdata(&op->dev, info); - printk("%s: cg3 at %lx:%lx\n", + printk(KERN_INFO "%s: cg3 at %lx:%lx\n", dp->full_name, par->which_io, par->physbase); return 0;