]> Pileus Git - ~andy/linux/blobdiff - drivers/video/xilinxfb.c
[POWERPC] XilinxFB: Replace calls to printk with dev_dbg, dev_err, etc.
[~andy/linux] / drivers / video / xilinxfb.c
index 6ef9733a18d4ca2aa7294a803006e319993d48c5..e63cbd1acfd2f024776a430488665fb259b8e47c 100644 (file)
@@ -18,6 +18,7 @@
  * Geert Uytterhoeven.
  */
 
+#include <linux/device.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/version.h>
@@ -30,7 +31,7 @@
 #include <linux/platform_device.h>
 
 #include <asm/io.h>
-#include <syslib/virtex_devices.h>
+#include <linux/xilinxfb.h>
 
 #define DRIVER_NAME            "xilinxfb"
 #define DRIVER_DESCRIPTION     "Xilinx TFT LCD frame buffer driver"
@@ -214,7 +215,7 @@ xilinxfb_drv_probe(struct device *dev)
 
        drvdata = kzalloc(sizeof(*drvdata), GFP_KERNEL);
        if (!drvdata) {
-               printk(KERN_ERR "Couldn't allocate device private record\n");
+               dev_err(dev, "Couldn't allocate device private record\n");
                return -ENOMEM;
        }
        dev_set_drvdata(dev, drvdata);
@@ -222,14 +223,13 @@ xilinxfb_drv_probe(struct device *dev)
        /* Map the control registers in */
        regs_res = platform_get_resource(pdev, IORESOURCE_IO, 0);
        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;
                goto failed1;
        }
 
        if (!request_mem_region(regs_res->start, 8, DRIVER_NAME)) {
-               printk(KERN_ERR
-                      "Couldn't lock memory region at 0x%08X\n",
+               dev_err(dev, "Couldn't lock memory region at 0x%08X\n",
                       regs_res->start);
                retval = -EBUSY;
                goto failed1;
@@ -241,7 +241,7 @@ xilinxfb_drv_probe(struct device *dev)
        drvdata->fb_virt = dma_alloc_coherent(dev, PAGE_ALIGN(FB_SIZE),
                                &drvdata->fb_phys, GFP_KERNEL);
        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;
                goto failed2;
        }
@@ -267,7 +267,7 @@ xilinxfb_drv_probe(struct device *dev)
        drvdata->info.pseudo_palette = drvdata->pseudo_palette;
 
        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);
                retval = -EFAULT;
                goto failed3;
@@ -282,11 +282,16 @@ xilinxfb_drv_probe(struct device *dev)
 
        /* Register new frame buffer */
        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;
                goto failed4;
        }
 
+       /* Put a banner in the log (for DEBUG) */
+       dev_dbg(dev, "regs: phys=%x, virt=%p\n",
+               drvdata->regs_phys, drvdata->regs);
+       dev_dbg(dev, "fb: phys=%p, virt=%p, size=%x\n",
+               (void*)drvdata->fb_phys, drvdata->fb_virt, FB_SIZE);
        return 0;       /* success */
 
 failed4: