diff options
| -rw-r--r-- | drivers/mtd/maps/physmap.c | 16 | ||||
| -rw-r--r-- | include/linux/mtd/physmap.h | 2 |
2 files changed, 17 insertions, 1 deletions
diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c index 7522df4f71f1..49676b7a53a4 100644 --- a/drivers/mtd/maps/physmap.c +++ b/drivers/mtd/maps/physmap.c | |||
| @@ -67,6 +67,10 @@ static int physmap_flash_remove(struct platform_device *dev) | |||
| 67 | if (info->mtd[i] != NULL) | 67 | if (info->mtd[i] != NULL) |
| 68 | map_destroy(info->mtd[i]); | 68 | map_destroy(info->mtd[i]); |
| 69 | } | 69 | } |
| 70 | |||
| 71 | if (physmap_data->exit) | ||
| 72 | physmap_data->exit(dev); | ||
| 73 | |||
| 70 | return 0; | 74 | return 0; |
| 71 | } | 75 | } |
| 72 | 76 | ||
| @@ -77,7 +81,11 @@ static const char *rom_probe_types[] = { | |||
| 77 | "map_rom", | 81 | "map_rom", |
| 78 | NULL }; | 82 | NULL }; |
| 79 | #ifdef CONFIG_MTD_PARTITIONS | 83 | #ifdef CONFIG_MTD_PARTITIONS |
| 80 | static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", NULL }; | 84 | static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", |
| 85 | #ifdef CONFIG_MTD_AFS_PARTS | ||
| 86 | "afs", | ||
| 87 | #endif | ||
| 88 | NULL }; | ||
| 81 | #endif | 89 | #endif |
| 82 | 90 | ||
| 83 | static int physmap_flash_probe(struct platform_device *dev) | 91 | static int physmap_flash_probe(struct platform_device *dev) |
| @@ -100,6 +108,12 @@ static int physmap_flash_probe(struct platform_device *dev) | |||
| 100 | goto err_out; | 108 | goto err_out; |
| 101 | } | 109 | } |
| 102 | 110 | ||
| 111 | if (physmap_data->init) { | ||
| 112 | err = physmap_data->init(dev); | ||
| 113 | if (err) | ||
| 114 | goto err_out; | ||
| 115 | } | ||
| 116 | |||
| 103 | platform_set_drvdata(dev, info); | 117 | platform_set_drvdata(dev, info); |
| 104 | 118 | ||
| 105 | for (i = 0; i < dev->num_resources; i++) { | 119 | for (i = 0; i < dev->num_resources; i++) { |
diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h index bcfd9f777454..d37cca05e62c 100644 --- a/include/linux/mtd/physmap.h +++ b/include/linux/mtd/physmap.h | |||
| @@ -22,6 +22,8 @@ struct map_info; | |||
| 22 | 22 | ||
| 23 | struct physmap_flash_data { | 23 | struct physmap_flash_data { |
| 24 | unsigned int width; | 24 | unsigned int width; |
| 25 | int (*init)(struct platform_device *); | ||
| 26 | void (*exit)(struct platform_device *); | ||
| 25 | void (*set_vpp)(struct map_info *, int); | 27 | void (*set_vpp)(struct map_info *, int); |
| 26 | unsigned int nr_parts; | 28 | unsigned int nr_parts; |
| 27 | unsigned int pfow_base; | 29 | unsigned int pfow_base; |
