aboutsummaryrefslogtreecommitdiff
path: root/drivers/video
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-08-27 15:06:28 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-08-27 15:06:28 -0700
commit5a99efeaa5c7139b7d76cbd5fb54fac664ba3da9 (patch)
treef86488005a159beb5e7fc733b3c5ab07fadb5cc2 /drivers/video
parent28d9aa613daa65b295a099a8433df97de1c56a2f (diff)
parent17a82e932d67e2885d9fa18d4656ff53337b1130 (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6: [SPARC32]: Make flush_tlb_kernel_range() an inline function. [SERIAL]: Fix 32-bit warnings in sunzilog.c and sunsu.c [SPARC32]: Kill unused vars and macros from prom/console.c [SPARC32]: Add __cmpdi2() libcall implementation ala. MIPS. [VIDEO]: Do not prom_halt() in cg3 and bw2 device probe. [SUNVDC]: Use slice 0xff on VD_DISK_TYPE_DISK.
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 718b9f83736..833b10c8406 100644
--- a/drivers/video/bw2.c
+++ b/drivers/video/bw2.c
@@ -233,9 +233,9 @@ static u8 bw2regs_66hz[] __devinitdata = {
0x10, 0x20, 0
};
-static void __devinit bw2_do_default_mode(struct bw2_par *par,
- struct fb_info *info,
- int *linebytes)
+static int __devinit bw2_do_default_mode(struct bw2_par *par,
+ struct fb_info *info,
+ int *linebytes)
{
u8 status, mon;
u8 *p;
@@ -266,17 +266,18 @@ static void __devinit bw2_do_default_mode(struct bw2_par *par,
break;
case BWTWO_SR_ID_NOCONN:
- return;
+ return 0;
default:
- prom_printf("bw2: can't handle SR %02x\n",
- status);
- prom_halt();
+ printk(KERN_ERR "bw2: can't handle SR %02x\n",
+ status);
+ return -EINVAL;
}
for ( ; *p; p += 2) {
u8 __iomem *regp = &((u8 __iomem *)par->regs)[p[0]];
sbus_writeb(p[1], regp);
}
+ return 0;
}
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 *
if (!par->regs)
goto out_release_fb;
- if (!of_find_property(dp, "width", NULL))
- bw2_do_default_mode(par, info, &linebytes);
+ if (!of_find_property(dp, "width", NULL)) {
+ err = bw2_do_default_mode(par, info, &linebytes);
+ if (err)
+ goto out_unmap_regs;
+ }
par->fbsize = PAGE_ALIGN(linebytes * info->var.yres);
diff --git a/drivers/video/cg3.c b/drivers/video/cg3.c
index 5741b46ade1..a5c7fb33152 100644
--- a/drivers/video/cg3.c
+++ b/drivers/video/cg3.c
@@ -315,7 +315,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 +332,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 +350,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,
@@ -400,8 +400,11 @@ static int __devinit cg3_probe(struct of_device *op,
cg3_blank(0, 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;