drivers: net: cpsw: fix for cpsw crash when build as modules
[linux-2.6-microblaze.git] / drivers / video / amba-clcd.c
index 0a2cce7..14d6b37 100644 (file)
@@ -10,6 +10,7 @@
  *
  *  ARM PrimeCell PL110 Color LCD Controller
  */
+#include <linux/dma-mapping.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
@@ -544,13 +545,17 @@ static int clcdfb_register(struct clcd_fb *fb)
 
 static int clcdfb_probe(struct amba_device *dev, const struct amba_id *id)
 {
-       struct clcd_board *board = dev->dev.platform_data;
+       struct clcd_board *board = dev_get_platdata(&dev->dev);
        struct clcd_fb *fb;
        int ret;
 
        if (!board)
                return -EINVAL;
 
+       ret = dma_set_mask_and_coherent(&dev->dev, DMA_BIT_MASK(32));
+       if (ret)
+               goto out;
+
        ret = amba_request_regions(dev, NULL);
        if (ret) {
                printk(KERN_ERR "CLCD: unable to reserve regs region\n");
@@ -594,8 +599,6 @@ static int clcdfb_remove(struct amba_device *dev)
 {
        struct clcd_fb *fb = amba_get_drvdata(dev);
 
-       amba_set_drvdata(dev, NULL);
-
        clcdfb_disable(fb);
        unregister_framebuffer(&fb->fb);
        if (fb->fb.cmap.len)