]> rtime.felk.cvut.cz Git - lisovros/linux_canprio.git/blobdiff - drivers/mtd/maps/shark_pmap_of.c
Update Shark 5200 patch to 2.6.36.1
[lisovros/linux_canprio.git] / drivers / mtd / maps / shark_pmap_of.c
index ff2ad98633f65f03be560f0a95c4f361d24d5522..ec24c0ea1124466d5ddfc3d579f1008f65124abc 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/mtd/partitions.h>
 #include <linux/of.h>
 #include <linux/of_platform.h>
+#include <linux/slab.h>
 
 struct of_flash {
        struct mtd_info         *mtd;
@@ -98,7 +99,7 @@ static void __xipram of_shark_map_copy_to(struct map_info *map, unsigned long to
 #ifdef CONFIG_MTD_PARTITIONS
 #define OF_FLASH_PARTS(info)   ((info)->parts)
 
-static int parse_obsolete_partitions(struct of_device *dev,
+static int parse_obsolete_partitions(struct platform_device *dev,
                                     struct of_flash *info,
                                     struct device_node *dp)
 {
@@ -148,7 +149,7 @@ static int parse_obsolete_partitions(struct of_device *dev,
 #define parse_partitions(info, dev)    (0)
 #endif /* MTD_PARTITIONS */
 
-static int of_shark_flash_remove(struct of_device *dev)
+static int of_shark_flash_remove(struct platform_device *dev)
 {
        struct of_flash *info;
 
@@ -184,10 +185,10 @@ static int of_shark_flash_remove(struct of_device *dev)
 /* Helper function to handle probing of the obsolete "direct-mapped"
  * compatible binding, which has an extra "probe-type" property
  * describing the type of flash probe necessary. */
-static struct mtd_info * __devinit obsolete_probe(struct of_device *dev,
+static struct mtd_info * __devinit obsolete_probe(struct platform_device *dev,
                                                  struct map_info *map)
 {
-       struct device_node *dp = dev->node;
+       struct device_node *dp = dev->dev.of_node;
        const char *of_probe;
        struct mtd_info *mtd;
        static const char *rom_probe_types[]
@@ -217,14 +218,14 @@ static struct mtd_info * __devinit obsolete_probe(struct of_device *dev,
        }
 }
 
-static int __devinit of_shark_flash_probe(struct of_device *dev,
+static int __devinit of_shark_flash_probe(struct platform_device *dev,
                                    const struct of_device_id *match)
 {
 #ifdef CONFIG_MTD_PARTITIONS
        static const char *part_probe_types[]
                = { "cmdlinepart", "RedBoot", NULL };
 #endif
-       struct device_node *dp = dev->node;
+       struct device_node *dp = dev->dev.of_node;
        struct device_node *np_sys;
        struct resource res;
        struct of_flash *info;
@@ -367,8 +368,12 @@ static struct of_device_id of_shark_flash_match[] = {
 MODULE_DEVICE_TABLE(of, of_flash_match);
 
 static struct of_platform_driver of_shark_flash_driver = {
-       .name           = "of-flash",
-       .match_table    = of_shark_flash_match,
+       .driver         = {
+               .name           = "of-flash",
+               .owner          = THIS_MODULE,
+               .of_match_table = of_shark_flash_match,
+
+       },
        .probe          = of_shark_flash_probe,
        .remove         = of_shark_flash_remove,
 };