0005-mtd-physmap_of-Move-custom-initialization.patch 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. From 58ecb60d53d43e8d584708722a2cf851ba88f9e1 Mon Sep 17 00:00:00 2001
  2. From: Linus Walleij <[email protected]>
  3. Date: Thu, 11 Oct 2018 19:53:40 +0200
  4. Subject: [PATCH 05/18] mtd: physmap_of: Move custom initialization
  5. In order to be able to assign custom complex mappings
  6. to the physmap_of plugin for Gemini, move the initialization
  7. so that the simple map is initialized before we enter the
  8. platform-specific functions so the latter can override
  9. them.
  10. Signed-off-by: Linus Walleij <[email protected]>
  11. ---
  12. drivers/mtd/maps/physmap_of_core.c | 15 ++++++++-------
  13. 1 file changed, 8 insertions(+), 7 deletions(-)
  14. diff --git a/drivers/mtd/maps/physmap_of_core.c b/drivers/mtd/maps/physmap_of_core.c
  15. index 4129535b8e46..74ad753265f3 100644
  16. --- a/drivers/mtd/maps/physmap_of_core.c
  17. +++ b/drivers/mtd/maps/physmap_of_core.c
  18. @@ -239,13 +239,6 @@ static int of_flash_probe(struct platform_device *dev)
  19. else if (of_property_read_bool(dp, "little-endian"))
  20. info->list[i].map.swap = CFI_LITTLE_ENDIAN;
  21. - err = of_flash_probe_gemini(dev, dp, &info->list[i].map);
  22. - if (err)
  23. - goto err_out;
  24. - err = of_flash_probe_versatile(dev, dp, &info->list[i].map);
  25. - if (err)
  26. - goto err_out;
  27. -
  28. err = -ENOMEM;
  29. info->list[i].map.virt = ioremap(info->list[i].map.phys,
  30. info->list[i].map.size);
  31. @@ -257,6 +250,14 @@ static int of_flash_probe(struct platform_device *dev)
  32. simple_map_init(&info->list[i].map);
  33. + /* Variants can override map accessors */
  34. + err = of_flash_probe_gemini(dev, dp, &info->list[i].map);
  35. + if (err)
  36. + goto err_out;
  37. + err = of_flash_probe_versatile(dev, dp, &info->list[i].map);
  38. + if (err)
  39. + goto err_out;
  40. +
  41. /*
  42. * On some platforms (e.g. MPC5200) a direct 1:1 mapping
  43. * may cause problems with JFFS2 usage, as the local bus (LPB)
  44. --
  45. 2.19.2