public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 1/2 v2] mtd: maps: Leave assigned complex mappings
@ 2018-11-12 21:07 Linus Walleij
  2018-11-12 21:07 ` [PATCH 2/2 v2] mtd: physmap_of_gemini: Handle pin control Linus Walleij
  2018-11-20 13:43 ` [PATCH 1/2 v2] mtd: maps: Leave assigned complex mappings Boris Brezillon
  0 siblings, 2 replies; 7+ messages in thread
From: Linus Walleij @ 2018-11-12 21:07 UTC (permalink / raw)
  To: David Woodhouse, Brian Norris, Boris Brezillon, Marek Vasut,
	Richard Weinberger, linux-mtd
  Cc: Linus Walleij

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@linaro.org>
---
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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-11-30 15:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-12 21:07 [PATCH 1/2 v2] mtd: maps: Leave assigned complex mappings Linus Walleij
2018-11-12 21:07 ` [PATCH 2/2 v2] mtd: physmap_of_gemini: Handle pin control Linus Walleij
2018-11-20 14:36   ` Boris Brezillon
2018-11-22 14:10     ` Linus Walleij
2018-11-30 11:17       ` Boris Brezillon
2018-11-30 15:14         ` Linus Walleij
2018-11-20 13:43 ` [PATCH 1/2 v2] mtd: maps: Leave assigned complex mappings Boris Brezillon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox