diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2012-11-07 10:32:16 -0500 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2012-11-16 03:57:39 -0500 |
commit | d68cbdd4fb04d2b756ad53c22f36943167b16340 (patch) | |
tree | 950b1200ea6f133406ba2fabeb3b15a843e649c6 /drivers/mtd | |
parent | d6ba745d0a073a0f48053fa4744ab2e86c310aad (diff) |
mtd: physmap_of: allow to specify the mtd name for retro compatiblity
linux,mtd-name allow to specify the mtd name for retro capability with
physmap-flash drivers as boot loader pass the mtd partition via the old
device name physmap-flash.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/maps/physmap_of.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/mtd/maps/physmap_of.c b/drivers/mtd/maps/physmap_of.c index 6f19acadb06c..d7f19bc6de4a 100644 --- a/drivers/mtd/maps/physmap_of.c +++ b/drivers/mtd/maps/physmap_of.c | |||
@@ -170,6 +170,7 @@ static int __devinit of_flash_probe(struct platform_device *dev) | |||
170 | resource_size_t res_size; | 170 | resource_size_t res_size; |
171 | struct mtd_part_parser_data ppdata; | 171 | struct mtd_part_parser_data ppdata; |
172 | bool map_indirect; | 172 | bool map_indirect; |
173 | const char *mtd_name; | ||
173 | 174 | ||
174 | match = of_match_device(of_flash_match, &dev->dev); | 175 | match = of_match_device(of_flash_match, &dev->dev); |
175 | if (!match) | 176 | if (!match) |
@@ -178,6 +179,8 @@ static int __devinit of_flash_probe(struct platform_device *dev) | |||
178 | 179 | ||
179 | reg_tuple_size = (of_n_addr_cells(dp) + of_n_size_cells(dp)) * sizeof(u32); | 180 | reg_tuple_size = (of_n_addr_cells(dp) + of_n_size_cells(dp)) * sizeof(u32); |
180 | 181 | ||
182 | of_property_read_string(dp, "linux,mtd-name", &mtd_name); | ||
183 | |||
181 | /* | 184 | /* |
182 | * Get number of "reg" tuples. Scan for MTD devices on area's | 185 | * Get number of "reg" tuples. Scan for MTD devices on area's |
183 | * described by each "reg" region. This makes it possible (including | 186 | * described by each "reg" region. This makes it possible (including |
@@ -234,7 +237,7 @@ static int __devinit of_flash_probe(struct platform_device *dev) | |||
234 | goto err_out; | 237 | goto err_out; |
235 | } | 238 | } |
236 | 239 | ||
237 | info->list[i].map.name = dev_name(&dev->dev); | 240 | info->list[i].map.name = mtd_name ?: dev_name(&dev->dev); |
238 | info->list[i].map.phys = res.start; | 241 | info->list[i].map.phys = res.start; |
239 | info->list[i].map.size = res_size; | 242 | info->list[i].map.size = res_size; |
240 | info->list[i].map.bankwidth = be32_to_cpup(width); | 243 | info->list[i].map.bankwidth = be32_to_cpup(width); |