aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/maps/physmap.c
diff options
context:
space:
mode:
authorBarry Song <21cnbao@gmail.com>2010-01-15 02:50:14 -0500
committerDavid Woodhouse <David.Woodhouse@intel.com>2010-08-08 07:28:15 -0400
commit78ef7fab0eb0a5b159842bac89aed74bb0aa7bfe (patch)
tree98aff2083703762b75e8ecb7e0e8a27ec9c8df9a /drivers/mtd/maps/physmap.c
parent73ee5760253dc8893502e19a9cb118d25dab21ec (diff)
mtd-physmap: add support users can assign the probe type in board files
There are three reasons to add this support: 1. users probably know the interface type of their flashs, then probe can be faster if they give the right type in platform data since wrong types will not be detected. 2. sometimes, detecting can cause destory to system. For example, for kernel XIP, detecting can cause NOR enter a mode instructions can not be fetched right, which will make kernel crash. 3. For a new probe which is not listed in the rom_probe_types, if users assign it in board files, physmap can still probe it. Signed-off-by: Barry Song <21cnbao@gmail.com> Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/maps/physmap.c')
-rw-r--r--drivers/mtd/maps/physmap.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c
index 829aa4bee54f..4c18b98a3110 100644
--- a/drivers/mtd/maps/physmap.c
+++ b/drivers/mtd/maps/physmap.c
@@ -136,8 +136,12 @@ static int physmap_flash_probe(struct platform_device *dev)
136 simple_map_init(&info->map[i]); 136 simple_map_init(&info->map[i]);
137 137
138 probe_type = rom_probe_types; 138 probe_type = rom_probe_types;
139 for (; info->mtd[i] == NULL && *probe_type != NULL; probe_type++) 139 if (physmap_data->probe_type == NULL) {
140 info->mtd[i] = do_map_probe(*probe_type, &info->map[i]); 140 for (; info->mtd[i] == NULL && *probe_type != NULL; probe_type++)
141 info->mtd[i] = do_map_probe(*probe_type, &info->map[i]);
142 } else
143 info->mtd[i] = do_map_probe(physmap_data->probe_type, &info->map[i]);
144
141 if (info->mtd[i] == NULL) { 145 if (info->mtd[i] == NULL) {
142 dev_err(&dev->dev, "map_probe failed\n"); 146 dev_err(&dev->dev, "map_probe failed\n");
143 err = -ENXIO; 147 err = -ENXIO;