aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/bw2.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-08-27 18:06:28 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-08-27 18:06:28 -0400
commit5a99efeaa5c7139b7d76cbd5fb54fac664ba3da9 (patch)
treef86488005a159beb5e7fc733b3c5ab07fadb5cc2 /drivers/video/bw2.c
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/bw2.c')
-rw-r--r--drivers/video/bw2.c22
1 files changed, 13 insertions, 9 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