[PATCH 1/2 v2] mtd: maps: Leave assigned complex mappings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The simple_map_init() may need to be called with some
function pointers already assigned for complex mappings,
just bail out if complex handlers have already been
assigned.

Signed-off-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
---
ChangeLog v1->v2:
- Rebase on latest MTD development branch
- Use a new approach as the code changed under me
---
 drivers/mtd/maps/map_funcs.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/mtd/maps/map_funcs.c b/drivers/mtd/maps/map_funcs.c
index 3f268370eeca..60e132293e1c 100644
--- a/drivers/mtd/maps/map_funcs.c
+++ b/drivers/mtd/maps/map_funcs.c
@@ -31,6 +31,10 @@ static void __xipram simple_map_copy_to(struct map_info *map, unsigned long to,
 
 void simple_map_init(struct map_info *map)
 {
+	/* Complex map functions already assigned */
+	if (map->read)
+		return;
+
 	BUG_ON(!map_bankwidth_supported(map->bankwidth));
 
 	map->read = simple_map_read;
-- 
2.19.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux