Commit 3cb3ec2c authored by Grant Likely's avatar Grant Likely

[POWERPC] XilinxFB: Replace calls to printk with dev_dbg, dev_err, etc.

The dev_dbg, dev_err, etc functions provide more context that plain
vanilla printk which is useful for debugging.  Where appropriate,
change printk calls to the appropriate dev_*() call.
Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
Acked-by: default avatarAndrei Konovalov <akonovalov@ru.mvista.com>
parent 258de4ba
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
* Geert Uytterhoeven. * Geert Uytterhoeven.
*/ */
#include <linux/device.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/version.h> #include <linux/version.h>
...@@ -214,7 +215,7 @@ xilinxfb_drv_probe(struct device *dev) ...@@ -214,7 +215,7 @@ xilinxfb_drv_probe(struct device *dev)
drvdata = kzalloc(sizeof(*drvdata), GFP_KERNEL); drvdata = kzalloc(sizeof(*drvdata), GFP_KERNEL);
if (!drvdata) { if (!drvdata) {
printk(KERN_ERR "Couldn't allocate device private record\n"); dev_err(dev, "Couldn't allocate device private record\n");
return -ENOMEM; return -ENOMEM;
} }
dev_set_drvdata(dev, drvdata); dev_set_drvdata(dev, drvdata);
...@@ -222,14 +223,13 @@ xilinxfb_drv_probe(struct device *dev) ...@@ -222,14 +223,13 @@ xilinxfb_drv_probe(struct device *dev)
/* Map the control registers in */ /* Map the control registers in */
regs_res = platform_get_resource(pdev, IORESOURCE_IO, 0); regs_res = platform_get_resource(pdev, IORESOURCE_IO, 0);
if (!regs_res || (regs_res->end - regs_res->start + 1 < 8)) { if (!regs_res || (regs_res->end - regs_res->start + 1 < 8)) {
printk(KERN_ERR "Couldn't get registers resource\n"); dev_err(dev, "Couldn't get registers resource\n");
retval = -EFAULT; retval = -EFAULT;
goto failed1; goto failed1;
} }
if (!request_mem_region(regs_res->start, 8, DRIVER_NAME)) { if (!request_mem_region(regs_res->start, 8, DRIVER_NAME)) {
printk(KERN_ERR dev_err(dev, "Couldn't lock memory region at 0x%08X\n",
"Couldn't lock memory region at 0x%08X\n",
regs_res->start); regs_res->start);
retval = -EBUSY; retval = -EBUSY;
goto failed1; goto failed1;
...@@ -241,7 +241,7 @@ xilinxfb_drv_probe(struct device *dev) ...@@ -241,7 +241,7 @@ xilinxfb_drv_probe(struct device *dev)
drvdata->fb_virt = dma_alloc_coherent(dev, PAGE_ALIGN(FB_SIZE), drvdata->fb_virt = dma_alloc_coherent(dev, PAGE_ALIGN(FB_SIZE),
&drvdata->fb_phys, GFP_KERNEL); &drvdata->fb_phys, GFP_KERNEL);
if (!drvdata->fb_virt) { if (!drvdata->fb_virt) {
printk(KERN_ERR "Could not allocate frame buffer memory\n"); dev_err(dev, "Could not allocate frame buffer memory\n");
retval = -ENOMEM; retval = -ENOMEM;
goto failed2; goto failed2;
} }
...@@ -267,7 +267,7 @@ xilinxfb_drv_probe(struct device *dev) ...@@ -267,7 +267,7 @@ xilinxfb_drv_probe(struct device *dev)
drvdata->info.pseudo_palette = drvdata->pseudo_palette; drvdata->info.pseudo_palette = drvdata->pseudo_palette;
if (fb_alloc_cmap(&drvdata->info.cmap, PALETTE_ENTRIES_NO, 0) < 0) { if (fb_alloc_cmap(&drvdata->info.cmap, PALETTE_ENTRIES_NO, 0) < 0) {
printk(KERN_ERR "Fail to allocate colormap (%d entries)\n", dev_err(dev, "Fail to allocate colormap (%d entries)\n",
PALETTE_ENTRIES_NO); PALETTE_ENTRIES_NO);
retval = -EFAULT; retval = -EFAULT;
goto failed3; goto failed3;
...@@ -282,7 +282,7 @@ xilinxfb_drv_probe(struct device *dev) ...@@ -282,7 +282,7 @@ xilinxfb_drv_probe(struct device *dev)
/* Register new frame buffer */ /* Register new frame buffer */
if (register_framebuffer(&drvdata->info) < 0) { if (register_framebuffer(&drvdata->info) < 0) {
printk(KERN_ERR "Could not register frame buffer\n"); dev_err(dev, "Could not register frame buffer\n");
retval = -EINVAL; retval = -EINVAL;
goto failed4; goto failed4;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment