All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] mtd: physmap_of: Move custom initialization
@ 2018-10-11 18:53 Linus Walleij
  2018-10-11 18:53 ` [PATCH 2/2] mtd: physmap_of_gemini: Handle pin control Linus Walleij
  2018-10-12  9:20 ` [PATCH 1/2] mtd: physmap_of: Move custom initialization Boris Brezillon
  0 siblings, 2 replies; 5+ messages in thread
From: Linus Walleij @ 2018-10-11 18:53 UTC (permalink / raw)
  To: David Woodhouse, Brian Norris, Boris Brezillon, Marek Vasut,
	Richard Weinberger, linux-mtd
  Cc: Linus Walleij

In order to be able to assign custom complex mappings
to the physmap_of plugin for Gemini, move the initialization
so that the simple map is initialized before we enter the
platform-specific functions so the latter can override
them.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/mtd/maps/physmap_of_core.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/mtd/maps/physmap_of_core.c b/drivers/mtd/maps/physmap_of_core.c
index 4129535b8e46..74ad753265f3 100644
--- a/drivers/mtd/maps/physmap_of_core.c
+++ b/drivers/mtd/maps/physmap_of_core.c
@@ -239,13 +239,6 @@ static int of_flash_probe(struct platform_device *dev)
 		else if (of_property_read_bool(dp, "little-endian"))
 			info->list[i].map.swap = CFI_LITTLE_ENDIAN;
 
-		err = of_flash_probe_gemini(dev, dp, &info->list[i].map);
-		if (err)
-			goto err_out;
-		err = of_flash_probe_versatile(dev, dp, &info->list[i].map);
-		if (err)
-			goto err_out;
-
 		err = -ENOMEM;
 		info->list[i].map.virt = ioremap(info->list[i].map.phys,
 						 info->list[i].map.size);
@@ -257,6 +250,14 @@ static int of_flash_probe(struct platform_device *dev)
 
 		simple_map_init(&info->list[i].map);
 
+		/* Variants can override map accessors */
+		err = of_flash_probe_gemini(dev, dp, &info->list[i].map);
+		if (err)
+			goto err_out;
+		err = of_flash_probe_versatile(dev, dp, &info->list[i].map);
+		if (err)
+			goto err_out;
+
 		/*
 		 * On some platforms (e.g. MPC5200) a direct 1:1 mapping
 		 * may cause problems with JFFS2 usage, as the local bus (LPB)
-- 
2.17.1

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

end of thread, other threads:[~2018-10-14  6:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-11 18:53 [PATCH 1/2] mtd: physmap_of: Move custom initialization Linus Walleij
2018-10-11 18:53 ` [PATCH 2/2] mtd: physmap_of_gemini: Handle pin control Linus Walleij
2018-10-12  9:20 ` [PATCH 1/2] mtd: physmap_of: Move custom initialization Boris Brezillon
2018-10-13 16:26   ` Linus Walleij
2018-10-14  6:34     ` Boris Brezillon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.