diff options
author | Joe Perches <joe@perches.com> | 2013-09-19 18:35:55 -0700 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2013-10-29 12:53:07 +0200 |
commit | 31b6780c15a4e3a90fe260e977f5186772ce7afb (patch) | |
tree | 9147371d1b0f5b6dbf1806a7af125552a67fbc3b | |
parent | f51a07d05c5142e73f781d878f411d63d3548a49 (diff) |
framebuffer: Use fb_<level>
Neaten and shorten the code using the new fb_<level> macros.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
59 files changed, 186 insertions, 224 deletions
diff --git a/drivers/auxdisplay/cfag12864bfb.c b/drivers/auxdisplay/cfag12864bfb.c index d585735430d..a3874034e2c 100644 --- a/drivers/auxdisplay/cfag12864bfb.c +++ b/drivers/auxdisplay/cfag12864bfb.c @@ -102,8 +102,7 @@ static int cfag12864bfb_probe(struct platform_device *device) platform_set_drvdata(device, info); - printk(KERN_INFO "fb%d: %s frame buffer device\n", info->node, - info->fix.id); + fb_info(info, "%s frame buffer device\n", info->fix.id); return 0; diff --git a/drivers/video/68328fb.c b/drivers/video/68328fb.c index fa44fbed397..552258c8f99 100644 --- a/drivers/video/68328fb.c +++ b/drivers/video/68328fb.c @@ -478,11 +478,10 @@ int __init mc68x328fb_init(void) return -EINVAL; } - printk(KERN_INFO - "fb%d: %s frame buffer device\n", fb_info.node, fb_info.fix.id); - printk(KERN_INFO - "fb%d: %dx%dx%d at 0x%08lx\n", fb_info.node, - mc68x328fb_default.xres_virtual, mc68x328fb_default.yres_virtual, + fb_info(&fb_info, "%s frame buffer device\n", fb_info.fix.id); + fb_info(&fb_info, "%dx%dx%d at 0x%08lx\n", + mc68x328fb_default.xres_virtual, + mc68x328fb_default.yres_virtual, 1 << mc68x328fb_default.bits_per_pixel, videomemory); return 0; diff --git a/drivers/video/amifb.c b/drivers/video/amifb.c index 8ab304d1c85..0dac36ce09d 100644 --- a/drivers/video/amifb.c +++ b/drivers/video/amifb.c @@ -3742,8 +3742,8 @@ default_chipset: if (err) goto unset_drvdata; - printk("fb%d: %s frame buffer device, using %dK of video memory\n", - info->node, info->fix.id, info->fix.smem_len>>10); + fb_info(info, "%s frame buffer device, using %dK of video memory\n", + info->fix.id, info->fix.smem_len>>10); return 0; diff --git a/drivers/video/arcfb.c b/drivers/video/arcfb.c index e43401afdd0..1b0b233b8b3 100644 --- a/drivers/video/arcfb.c +++ b/drivers/video/arcfb.c @@ -556,9 +556,8 @@ static int arcfb_probe(struct platform_device *dev) goto err1; } } - printk(KERN_INFO - "fb%d: Arc frame buffer device, using %dK of video memory\n", - info->node, videomemorysize >> 10); + fb_info(info, "Arc frame buffer device, using %dK of video memory\n", + videomemorysize >> 10); /* this inits the lcd but doesn't clear dirty pixels */ for (i = 0; i < num_cols * num_rows; i++) { @@ -572,8 +571,7 @@ static int arcfb_probe(struct platform_device *dev) /* if we were told to splash the screen, we just clear it */ if (!nosplash) { for (i = 0; i < num_cols * num_rows; i++) { - printk(KERN_INFO "fb%d: splashing lcd %d\n", - info->node, i); + fb_info(info, "splashing lcd %d\n", i); ks108_set_start_line(par, i, 0); ks108_clear_lcd(par, i); } diff --git a/drivers/video/arkfb.c b/drivers/video/arkfb.c index 15dd5423d64..a6b29bd4a12 100644 --- a/drivers/video/arkfb.c +++ b/drivers/video/arkfb.c @@ -137,8 +137,7 @@ static void arkfb_settile(struct fb_info *info, struct fb_tilemap *map) if ((map->width != 8) || (map->height != 16) || (map->depth != 1) || (map->length != 256)) { - printk(KERN_ERR "fb%d: unsupported font parameters: width %d, " - "height %d, depth %d, length %d\n", info->node, + fb_err(info, "unsupported font parameters: width %d, height %d, depth %d, length %d\n", map->width, map->height, map->depth, map->length); return; } @@ -517,7 +516,7 @@ static void ark_set_pixclock(struct fb_info *info, u32 pixclock) int rv = dac_set_freq(par->dac, 0, 1000000000 / pixclock); if (rv < 0) { - printk(KERN_ERR "fb%d: cannot set requested pixclock, keeping old value\n", info->node); + fb_err(info, "cannot set requested pixclock, keeping old value\n"); return; } @@ -584,7 +583,7 @@ static int arkfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) rv = svga_match_format (arkfb_formats, var, NULL); if (rv < 0) { - printk(KERN_ERR "fb%d: unsupported mode requested\n", info->node); + fb_err(info, "unsupported mode requested\n"); return rv; } @@ -604,14 +603,15 @@ static int arkfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) mem = ((var->bits_per_pixel * var->xres_virtual) >> 3) * var->yres_virtual; if (mem > info->screen_size) { - printk(KERN_ERR "fb%d: not enough framebuffer memory (%d kB requested , %d kB available)\n", info->node, mem >> 10, (unsigned int) (info->screen_size >> 10)); + fb_err(info, "not enough framebuffer memory (%d kB requested, %d kB available)\n", + mem >> 10, (unsigned int) (info->screen_size >> 10)); return -EINVAL; } rv = svga_check_timings (&ark_timing_regs, var, info->node); if (rv < 0) { - printk(KERN_ERR "fb%d: invalid timings requested\n", info->node); + fb_err(info, "invalid timings requested\n"); return rv; } @@ -693,7 +693,7 @@ static int arkfb_set_par(struct fb_info *info) vga_wseq(par->state.vgabase, 0x18, regval); /* Set the offset register */ - pr_debug("fb%d: offset register : %d\n", info->node, offset_value); + fb_dbg(info, "offset register : %d\n", offset_value); svga_wcrt_multi(par->state.vgabase, ark_offset_regs, offset_value); /* fix for hi-res textmode */ @@ -716,7 +716,7 @@ static int arkfb_set_par(struct fb_info *info) /* Set mode-specific register values */ switch (mode) { case 0: - pr_debug("fb%d: text mode\n", info->node); + fb_dbg(info, "text mode\n"); svga_set_textmode_vga_regs(par->state.vgabase); vga_wseq(par->state.vgabase, 0x11, 0x10); /* basic VGA mode */ @@ -725,7 +725,7 @@ static int arkfb_set_par(struct fb_info *info) break; case 1: - pr_debug("fb%d: 4 bit pseudocolor\n", info->node); + fb_dbg(info, "4 bit pseudocolor\n"); vga_wgfx(par->state.vgabase, VGA_GFX_MODE, 0x40); vga_wseq(par->state.vgabase, 0x11, 0x10); /* basic VGA mode */ @@ -733,44 +733,44 @@ static int arkfb_set_par(struct fb_info *info) dac_set_mode(par->dac, DAC_PSEUDO8_8); break; case 2: - pr_debug("fb%d: 4 bit pseudocolor, planar\n", info->node); + fb_dbg(info, "4 bit pseudocolor, planar\n"); vga_wseq(par->state.vgabase, 0x11, 0x10); /* basic VGA mode */ svga_wcrt_mask(par->state.vgabase, 0x46, 0x00, 0x04); /* 8bit pixel path */ dac_set_mode(par->dac, DAC_PSEUDO8_8); break; case 3: - pr_debug("fb%d: 8 bit pseudocolor\n", info->node); + fb_dbg(info, "8 bit pseudocolor\n"); vga_wseq(par->state.vgabase, 0x11, 0x16); /* 8bpp accel mode */ if (info->var.pixclock > 20000) { - pr_debug("fb%d: not using multiplex\n", info->node); + fb_dbg(info, "not using multiplex\n"); svga_wcrt_mask(par->state.vgabase, 0x46, 0x00, 0x04); /* 8bit pixel path */ dac_set_mode(par->dac, DAC_PSEUDO8_8); } else { - pr_debug("fb%d: using multiplex\n", info->node); + fb_dbg(info, "using multiplex\n"); svga_wcrt_mask(par->state.vgabase, 0x46, 0x04, 0x04); /* 16bit pixel path */ dac_set_mode(par->dac, DAC_PSEUDO8_16); hdiv = 2; } break; case 4: - pr_debug("fb%d: 5/5/5 truecolor\n", info->node); + fb_dbg(info, "5/5/5 truecolor\n"); vga_wseq(par->state.vgabase, 0x11, 0x1A); /* 16bpp accel mode */ svga_wcrt_mask(par->state.vgabase, 0x46, 0x04, 0x04); /* 16bit pixel path */ dac_set_mode(par->dac, DAC_RGB1555_16); break; case 5: - pr_debug("fb%d: 5/6/5 truecolor\n", info->node); + fb_dbg(info, "5/6/5 truecolor\n"); vga_wseq(par->state.vgabase, 0x11, 0x1A); /* 16bpp accel mode */ svga_wcrt_mask(par->state.vgabase, 0x46, 0x04, 0x04); /* 16bit pixel path */ dac_set_mode(par->dac, DAC_RGB0565_16); break; case 6: - pr_debug("fb%d: 8/8/8 truecolor\n", info->node); + fb_dbg(info, "8/8/8 truecolor\n"); vga_wseq(par->state.vgabase, 0x11, 0x16); /* 8bpp accel mode ??? */ svga_wcrt_mask(par->state.vgabase, 0x46, 0x04, 0x04); /* 16bit pixel path */ @@ -779,7 +779,7 @@ static int arkfb_set_par(struct fb_info *info) hdiv = 2; break; case 7: - pr_debug("fb%d: 8/8/8/8 truecolor\n", info->node); + fb_dbg(info, "8/8/8/8 truecolor\n"); vga_wseq(par->state.vgabase, 0x11, 0x1E); /* 32bpp accel mode */ svga_wcrt_mask(par->state.vgabase, 0x46, 0x04, 0x04); /* 16bit pixel path */ @@ -787,7 +787,7 @@ static int arkfb_set_par(struct fb_info *info) hmul = 2; break; default: - printk(KERN_ERR "fb%d: unsupported mode - bug\n", info->node); + fb_err(info, "unsupported mode - bug\n"); return -EINVAL; } @@ -879,19 +879,19 @@ static int arkfb_blank(int blank_mode, struct fb_info *info) switch (blank_mode) { case FB_BLANK_UNBLANK: - pr_debug("fb%d: unblank\n", info->node); + fb_dbg(info, "unblank\n"); svga_wseq_mask(par->state.vgabase, 0x01, 0x00, 0x20); svga_wcrt_mask(par->state.vgabase, 0x17, 0x80, 0x80); break; case FB_BLANK_NORMAL: - pr_debug("fb%d: blank\n", info->node); + fb_dbg(info, "blank\n"); svga_wseq_mask(par->state.vgabase, 0x01, 0x20, 0x20); svga_wcrt_mask(par->state.vgabase, 0x17, 0x80, 0x80); break; case FB_BLANK_POWERDOWN: case FB_BLANK_HSYNC_SUSPEND: case FB_BLANK_VSYNC_SUSPEND: - pr_debug("fb%d: sync down\n", info->node); + fb_dbg(info, "sync down\n"); svga_wseq_mask(par->state.vgabase, 0x01, 0x20, 0x20); svga_wcrt_mask(par->state.vgabase, 0x17, 0x00, 0x80); break; @@ -1052,8 +1052,8 @@ static int ark_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) goto err_reg_fb; } - printk(KERN_INFO "fb%d: %s on %s, %d MB RAM\n", info->node, info->fix.id, - pci_name(dev), info->fix.smem_len >> 20); + fb_info(info, "%s on %s, %d MB RAM\n", + info->fix.id, pci_name(dev), info->fix.smem_len >> 20); /* Record a reference to the driver data */ pci_set_drvdata(dev, info); diff --git a/drivers/video/asiliantfb.c b/drivers/video/asiliantfb.c index d5a37d62847..d611f1a1ac5 100644 --- a/drivers/video/asiliantfb.c +++ b/drivers/video/asiliantfb.c @@ -527,8 +527,8 @@ static int init_asiliant(struct fb_info *p, unsigned long addr) return err; } - printk(KERN_INFO "fb%d: Asiliant 69000 frame buffer (%dK RAM detected)\n", - p->node, p->fix.smem_len / 1024); + fb_info(p, "Asiliant 69000 frame buffer (%dK RAM detected)\n", + p->fix.smem_len / 1024); writeb(0xff, mmio_base + 0x78c); chips_hw_init(p); diff --git a/drivers/video/atafb.c b/drivers/video/atafb.c index 64e41f5448c..e21d1f58554 100644 --- a/drivers/video/atafb.c +++ b/drivers/video/atafb.c @@ -3246,11 +3246,8 @@ int __init atafb_init(void) return -EINVAL; } - // FIXME: mode needs setting! - //printk("fb%d: %s frame buffer device, using %dK of video memory\n", - // fb_info.node, fb_info.mode->name, screen_len>>10); - printk("fb%d: frame buffer device, using %dK of video memory\n", - fb_info.node, screen_len >> 10); + fb_info(&fb_info, "frame buffer device, using %dK of video memory\n", + screen_len >> 10); /* TODO: This driver cannot be unloaded yet */ return 0; diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c index b5edb6f08b8..12ca031877d 100644 --- a/drivers/video/aty/aty128fb.c +++ b/drivers/video/aty/aty128fb.c @@ -2027,8 +2027,8 @@ static int aty128_init(struct pci_dev *pdev, const struct pci_device_id *ent) if (register_framebuffer(info) < 0) return 0; - printk(KERN_INFO "fb%d: %s frame buffer device on %s\n", - info->node, info->fix.id, video_card); + fb_info(info, "%s frame buffer device on %s\n", + info->fix.id, video_card); return 1; /* success! */ } diff --git a/drivers/video/broadsheetfb.c b/drivers/video/broadsheetfb.c index 393d5a03b34..8556264b16b 100644 --- a/drivers/video/broadsheetfb.c +++ b/drivers/video/broadsheetfb.c @@ -1167,9 +1167,8 @@ static int broadsheetfb_probe(struct platform_device *dev) if (retval < 0) goto err_unreg_fb; - printk(KERN_INFO - "fb%d: Broadsheet frame buffer, using %dK of video memory\n", - info->node, videomemorysize >> 10); + fb_info(info, "Broadsheet frame buffer, using %dK of video memory\n", + videomemorysize >> 10); return 0; diff --git a/drivers/video/carminefb.c b/drivers/video/carminefb.c index b98f709abf5..65f7c15f5fd 100644 --- a/drivers/video/carminefb.c +++ b/drivers/video/carminefb.c @@ -585,8 +585,7 @@ static int alloc_carmine_fb(void __iomem *regs, void __iomem *smem_base, if (ret < 0) goto err_dealloc_cmap; - printk(KERN_INFO "fb%d: %s frame buffer device\n", info->node, - info->fix.id); + fb_info(info, "%s frame buffer device\n", info->fix.id); *rinfo = info; return 0; diff --git a/drivers/video/cobalt_lcdfb.c b/drivers/video/cobalt_lcdfb.c index a7b0ab62b97..d5533f4db1c 100644 --- a/drivers/video/cobalt_lcdfb.c +++ b/drivers/video/cobalt_lcdfb.c @@ -368,8 +368,7 @@ static int cobalt_lcdfb_probe(struct platform_device *dev) lcd_clear(info); - printk(KERN_INFO "fb%d: Cobalt server LCD frame buffer device\n", - info->node); + fb_info(info, "Cobalt server LCD frame buffer device\n"); return 0; } diff --git a/drivers/video/controlfb.c b/drivers/video/controlfb.c index 67b77b40aa7..fdadef97923 100644 --- a/drivers/video/controlfb.c +++ b/drivers/video/controlfb.c @@ -471,8 +471,8 @@ try_again: /* Register with fbdev layer */ if (register_framebuffer(&p->info) < 0) return -ENXIO; - - printk(KERN_INFO "fb%d: control display adapter\n", p->info.node); + + fb_info(&p->info, "control display adapter\n"); return 0; } diff --git a/drivers/video/efifb.c b/drivers/video/efifb.c index fcb95003124..cd7c0df9f24 100644 --- a/drivers/video/efifb.c +++ b/drivers/video/efifb.c @@ -322,8 +322,7 @@ static int efifb_probe(struct platform_device *dev) printk(KERN_ERR "efifb: cannot register framebuffer\n"); goto err_fb_dealoc; } - printk(KERN_INFO "fb%d: %s frame buffer device\n", - info->node, info->fix.id); + fb_info(info, "%s frame buffer device\n", info->fix.id); return 0; err_fb_dealoc: diff --git a/drivers/video/fb-puv3.c b/drivers/video/fb-puv3.c index 27fc956166f..6db9ebd042a 100644 --- a/drivers/video/fb-puv3.c +++ b/drivers/video/fb-puv3.c @@ -713,9 +713,8 @@ static int unifb_probe(struct platform_device *dev) platform_set_drvdata(dev, info); platform_device_add_data(dev, unifb_regs, sizeof(u32) * UNIFB_REGS_NUM); - printk(KERN_INFO - "fb%d: Virtual frame buffer device, using %dM of video memory\n", - info->node, UNIFB_MEMSIZE >> 20); + fb_info(info, "Virtual frame buffer device, using %dM of video memory\n", + UNIFB_MEMSIZE >> 20); return 0; err2: fb_dealloc_cmap(&info->cmap); diff --git a/drivers/video/fm2fb.c b/drivers/video/fm2fb.c index c99c9671302..e69d47af993 100644 --- a/drivers/video/fm2fb.c +++ b/drivers/video/fm2fb.c @@ -289,7 +289,7 @@ static int fm2fb_probe(struct zorro_dev *z, const struct zorro_device_id *id) zorro_release_device(z); return -EINVAL; } - printk("fb%d: %s frame buffer device\n", info->node, fb_fix.id); + fb_info(info, "%s frame buffer device\n", fb_fix.id); return 0; } diff --git a/drivers/video/gbefb.c b/drivers/video/gbefb.c index ceab37020ff..4c7cb368a9d 100644 --- a/drivers/video/gbefb.c +++ b/drivers/video/gbefb.c @@ -1236,9 +1236,9 @@ static int gbefb_probe(struct platform_device *p_dev) platform_set_drvdata(p_dev, info); gbefb_create_sysfs(&p_dev->dev); - printk(KERN_INFO "fb%d: %s rev %d @ 0x%08x using %dkB memory\n", - info->node, info->fix.id, gbe_revision, (unsigned) GBE_BASE, - gbe_mem_size >> 10); + fb_info(info, "%s rev %d @ 0x%08x using %dkB memory\n", + info->fix.id, gbe_revision, (unsigned)GBE_BASE, + gbe_mem_size >> 10); return 0; diff --git a/drivers/video/geode/gx1fb_core.c b/drivers/video/geode/gx1fb_core.c index 7551a04f5c3..2794ba11f33 100644 --- a/drivers/video/geode/gx1fb_core.c +++ b/drivers/video/geode/gx1fb_core.c @@ -357,7 +357,7 @@ static int gx1fb_probe(struct pci_dev *pdev, const struct pci_device_id *id) goto err; } pci_set_drvdata(pdev, info); - printk(KERN_INFO "fb%d: %s frame buffer device\n", info->node, info->fix.id); + fb_info(info, "%s frame buffer device\n", info->fix.id); return 0; err: diff --git a/drivers/video/geode/gxfb_core.c b/drivers/video/geode/gxfb_core.c index a42d74d6ede..1790f14bab1 100644 --- a/drivers/video/geode/gxfb_core.c +++ b/drivers/video/geode/gxfb_core.c @@ -423,7 +423,7 @@ static int gxfb_probe(struct pci_dev *pdev, const struct pci_device_id *id) goto err; } pci_set_drvdata(pdev, info); - printk(KERN_INFO "fb%d: %s frame buffer device\n", info->node, info->fix.id); + fb_info(info, "%s frame buffer device\n", info->fix.id); return 0; err: diff --git a/drivers/video/geode/lxfb_core.c b/drivers/video/geode/lxfb_core.c index 10de31b21d0..9e1d19d673a 100644 --- a/drivers/video/geode/lxfb_core.c +++ b/drivers/video/geode/lxfb_core.c @@ -555,8 +555,7 @@ static int lxfb_probe(struct pci_dev *pdev, const struct pci_device_id *id) goto err; } pci_set_drvdata(pdev, info); - printk(KERN_INFO "fb%d: %s frame buffer device\n", - info->node, info->fix.id); + fb_info(info, "%s frame buffer device\n", info->fix.id); return 0; diff --git a/drivers/video/gxt4500.c b/drivers/video/gxt4500.c index c35663f6a54..135d78a0258 100644 --- a/drivers/video/gxt4500.c +++ b/drivers/video/gxt4500.c @@ -698,8 +698,7 @@ static int gxt4500_probe(struct pci_dev *pdev, const struct pci_device_id *ent) dev_err(&pdev->dev, "gxt4500: cannot register framebuffer\n"); goto err_free_cmap; } - printk(KERN_INFO "fb%d: %s frame buffer device\n", - info->node, info->fix.id); + fb_info(info, "%s frame buffer device\n", info->fix.id); return 0; diff --git a/drivers/video/hecubafb.c b/drivers/video/hecubafb.c index 702b599dc3d..f64120ec919 100644 --- a/drivers/video/hecubafb.c +++ b/drivers/video/hecubafb.c @@ -261,9 +261,8 @@ static int hecubafb_probe(struct platform_device *dev) goto err_fbreg; platform_set_drvdata(dev, info); - printk(KERN_INFO - "fb%d: Hecuba frame buffer device, using %dK of video memory\n", - info->node, videomemorysize >> 10); + fb_info(info, "Hecuba frame buffer device, using %dK of video memory\n", + videomemorysize >> 10); /* this inits the dpy */ retval = par->board->init(par); diff --git a/drivers/video/hgafb.c b/drivers/video/hgafb.c index 1e9e2d819d1..5ff9fe2116a 100644 --- a/drivers/video/hgafb.c +++ b/drivers/video/hgafb.c @@ -586,8 +586,7 @@ static int hgafb_probe(struct platform_device *pdev) return -EINVAL; } - printk(KERN_INFO "fb%d: %s frame buffer device\n", - info->node, info->fix.id); + fb_info(info, "%s frame buffer device\n", info->fix.id); platform_set_drvdata(pdev, info); return 0; } diff --git a/drivers/video/hitfb.c b/drivers/video/hitfb.c index c2414d6ab64..a648d5186c6 100644 --- a/drivers/video/hitfb.c +++ b/drivers/video/hitfb.c @@ -405,8 +405,7 @@ static int hitfb_probe(struct platform_device *dev) platform_set_drvdata(dev, info); - printk(KERN_INFO "fb%d: %s frame buffer device\n", - info->node, info->fix.id); + fb_info(info, "%s frame buffer device\n", info->fix.id); return 0; diff --git a/drivers/video/hpfb.c b/drivers/video/hpfb.c index b802f93cef5..a1b7e5fa9b0 100644 --- a/dr |