#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;
#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)
{
#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;
/* 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[]
}
}
-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;
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,
};