aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/bw2.c
diff options
context:
space:
mode:
authorKrzysztof Helt <krzysztof.h1@wp.pl>2009-05-04 06:35:36 -0400
committerDavid S. Miller <davem@davemloft.net>2009-06-16 07:56:30 -0400
commit3f06cd29358dd390d62afcde14fde54cec9deef9 (patch)
treec8d0a9ec9c72e0fa9d926015edbabbb54d532990 /drivers/video/bw2.c
parent280ff97494e0fef4124bee5c52e39b23a18dd283 (diff)
bw2: use standard fields for framebuffer physical address and length
Use standard fields fbinfo.fix.smem_start and fbinfo.fix.smem_len for physical address and length of framebuffer. This also fixes output of the 'fbset -i' command - address and length of the framebuffer is displayed correctly. Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/video/bw2.c')
-rw-r--r--drivers/video/bw2.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/video/bw2.c b/drivers/video/bw2.c
index 1e35ba6f18e0..b0b147cb4cb3 100644
--- a/drivers/video/bw2.c
+++ b/drivers/video/bw2.c
@@ -111,9 +111,7 @@ struct bw2_par {
111 u32 flags; 111 u32 flags;
112#define BW2_FLAG_BLANKED 0x00000001 112#define BW2_FLAG_BLANKED 0x00000001
113 113
114 unsigned long physbase;
115 unsigned long which_io; 114 unsigned long which_io;
116 unsigned long fbsize;
117}; 115};
118 116
119/** 117/**
@@ -167,17 +165,15 @@ static int bw2_mmap(struct fb_info *info, struct vm_area_struct *vma)
167 struct bw2_par *par = (struct bw2_par *)info->par; 165 struct bw2_par *par = (struct bw2_par *)info->par;
168 166
169 return sbusfb_mmap_helper(bw2_mmap_map, 167 return sbusfb_mmap_helper(bw2_mmap_map,
170 par->physbase, par->fbsize, 168 info->fix.smem_start, info->fix.smem_len,
171 par->which_io, 169 par->which_io,
172 vma); 170 vma);
173} 171}
174 172
175static int bw2_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) 173static int bw2_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
176{ 174{
177 struct bw2_par *par = (struct bw2_par *) info->par;
178
179 return sbusfb_ioctl_helper(cmd, arg, info, 175 return sbusfb_ioctl_helper(cmd, arg, info,
180 FBTYPE_SUN2BW, 1, par->fbsize); 176 FBTYPE_SUN2BW, 1, info->fix.smem_len);
181} 177}
182 178
183/* 179/*
@@ -294,7 +290,7 @@ static int __devinit bw2_probe(struct of_device *op, const struct of_device_id *
294 290
295 spin_lock_init(&par->lock); 291 spin_lock_init(&par->lock);
296 292
297 par->physbase = op->resource[0].start; 293 info->fix.smem_start = op->resource[0].start;
298 par->which_io = op->resource[0].flags & IORESOURCE_BITS; 294 par->which_io = op->resource[0].flags & IORESOURCE_BITS;
299 295
300 sbusfb_fill_var(&info->var, dp, 1); 296 sbusfb_fill_var(&info->var, dp, 1);
@@ -317,13 +313,13 @@ static int __devinit bw2_probe(struct of_device *op, const struct of_device_id *
317 goto out_unmap_regs; 313 goto out_unmap_regs;
318 } 314 }
319 315
320 par->fbsize = PAGE_ALIGN(linebytes * info->var.yres); 316 info->fix.smem_len = PAGE_ALIGN(linebytes * info->var.yres);
321 317
322 info->flags = FBINFO_DEFAULT; 318 info->flags = FBINFO_DEFAULT;
323 info->fbops = &bw2_ops; 319 info->fbops = &bw2_ops;
324 320
325 info->screen_base = of_ioremap(&op->resource[0], 0, 321 info->screen_base = of_ioremap(&op->resource[0], 0,
326 par->fbsize, "bw2 ram"); 322 info->fix.smem_len, "bw2 ram");
327 if (!info->screen_base) 323 if (!info->screen_base)
328 goto out_unmap_regs; 324 goto out_unmap_regs;
329 325
@@ -338,12 +334,12 @@ static int __devinit bw2_probe(struct of_device *op, const struct of_device_id *
338 dev_set_drvdata(&op->dev, info); 334 dev_set_drvdata(&op->dev, info);
339 335
340 printk(KERN_INFO "%s: bwtwo at %lx:%lx\n", 336 printk(KERN_INFO "%s: bwtwo at %lx:%lx\n",
341 dp->full_name, par->which_io, par->physbase); 337 dp->full_name, par->which_io, info->fix.smem_start);
342 338
343 return 0; 339 return 0;
344 340
345out_unmap_screen: 341out_unmap_screen:
346 of_iounmap(&op->resource[0], info->screen_base, par->fbsize); 342 of_iounmap(&op->resource[0], info->screen_base, info->fix.smem_len);
347 343
348out_unmap_regs: 344out_unmap_regs:
349 of_iounmap(&op->resource[0], par->regs, sizeof(struct bw2_regs)); 345 of_iounmap(&op->resource[0], par->regs, sizeof(struct bw2_regs));
@@ -363,7 +359,7 @@ static int __devexit bw2_remove(struct of_device *op)
363 unregister_framebuffer(info); 359 unregister_framebuffer(info);
364 360
365 of_iounmap(&op->resource[0], par->regs, sizeof(struct bw2_regs)); 361 of_iounmap(&op->resource[0], par->regs, sizeof(struct bw2_regs));
366 of_iounmap(&op->resource[0], info->screen_base, par->fbsize); 362 of_iounmap(&op->resource[0], info->screen_base, info->fix.smem_len);
367 363
368 framebuffer_release(info); 364 framebuffer_release(info);
369 365