ARM: at91: remove unnecessary of_platform_default_populate calls

Message ID 20230124112348.74198-1-nicolas.ferre@microchip.com
State New
Headers
Series ARM: at91: remove unnecessary of_platform_default_populate calls |

Commit Message

Nicolas Ferre Jan. 24, 2023, 11:23 a.m. UTC
  From: Rob Herring <robh@kernel.org>

DO NOT APPLY: breaking boot on at91 (sama5d3 xplained / NAND at least)

The DT core will call of_platform_default_populate, so it is not
necessary for machine specific code to call it unless there are custom
match entries, auxdata or parent device. Neither of those apply here, so
remove the call.

Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Rob Herring <robh@kernel.org>
[nicolas.ferre@microchip.com: update to newest kernel, add sama7.c file]
Signed-off-by: Nicolas Ferre <nicolas.ferre@microchip.com>
---
Rob, Alexandre,

This is the updated patch by Rob.
Tested on sama5d3 xplained platform it fails at least with NAND and, as you
observed Alexandre, SRAM.

The pinctrl patch [1] applied seem to solve the problem with GPIO/pinctrl.

So, this move is not ready now, but we can make progress, little by little.

Best regards,
  Nicolas

 arch/arm/mach-at91/at91rm9200.c | 5 -----
 arch/arm/mach-at91/at91sam9.c   | 5 -----
 arch/arm/mach-at91/sama5.c      | 7 +------
 arch/arm/mach-at91/sama7.c      | 4 ----
 4 files changed, 1 insertion(+), 20 deletions(-)
  

Comments

Nicolas Ferre Jan. 24, 2023, 12:42 p.m. UTC | #1
On 24/01/2023 at 12:23, nicolas.ferre@microchip.com wrote:
> From: Rob Herring <robh@kernel.org>
> 
> DO NOT APPLY: breaking boot on at91 (sama5d3 xplained / NAND at least)
> 
> The DT core will call of_platform_default_populate, so it is not
> necessary for machine specific code to call it unless there are custom
> match entries, auxdata or parent device. Neither of those apply here, so
> remove the call.
> 
> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
> Cc: linux-arm-kernel@lists.infradead.org
> Signed-off-by: Rob Herring <robh@kernel.org>
> [nicolas.ferre@microchip.com: update to newest kernel, add sama7.c file]
> Signed-off-by: Nicolas Ferre <nicolas.ferre@microchip.com>
> ---
> Rob, Alexandre,
> 
> This is the updated patch by Rob.
> Tested on sama5d3 xplained platform it fails at least with NAND and, as you
> observed Alexandre, SRAM.
> 
> The pinctrl patch [1] applied seem to solve the problem with GPIO/pinctrl.

Ref. missing:
[1] https://lore.kernel.org/all/20180712192222.32481-1-robh@kernel.org/

> 
> So, this move is not ready now, but we can make progress, little by little.
> 
> Best regards,
>    Nicolas
> 
>   arch/arm/mach-at91/at91rm9200.c | 5 -----
>   arch/arm/mach-at91/at91sam9.c   | 5 -----
>   arch/arm/mach-at91/sama5.c      | 7 +------
>   arch/arm/mach-at91/sama7.c      | 4 ----
>   4 files changed, 1 insertion(+), 20 deletions(-)
> 
> diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
> index 4f8186211619..e262f5459c76 100644
> --- a/arch/arm/mach-at91/at91rm9200.c
> +++ b/arch/arm/mach-at91/at91rm9200.c
> @@ -7,17 +7,12 @@
>    *                2012 Joachim Eastwood <manabian@gmail.com>
>    */
> 
> -#include <linux/of.h>
> -#include <linux/of_platform.h>
> -
>   #include <asm/mach/arch.h>
> 
>   #include "generic.h"
> 
>   static void __init at91rm9200_dt_device_init(void)
>   {
> -       of_platform_default_populate(NULL, NULL, NULL);
> -
>          at91rm9200_pm_init();
>   }
> 
> diff --git a/arch/arm/mach-at91/at91sam9.c b/arch/arm/mach-at91/at91sam9.c
> index 7e572189a5eb..74b4dd8403a2 100644
> --- a/arch/arm/mach-at91/at91sam9.c
> +++ b/arch/arm/mach-at91/at91sam9.c
> @@ -6,9 +6,6 @@
>    *                2011 Nicolas Ferre <nicolas.ferre@atmel.com>
>    */
> 
> -#include <linux/of.h>
> -#include <linux/of_platform.h>
> -
>   #include <asm/mach/arch.h>
>   #include <asm/system_misc.h>
> 
> @@ -16,8 +13,6 @@
> 
>   static void __init at91sam9_init(void)
>   {
> -       of_platform_default_populate(NULL, NULL, NULL);
> -
>          at91sam9_pm_init();
>   }
> 
> diff --git a/arch/arm/mach-at91/sama5.c b/arch/arm/mach-at91/sama5.c
> index bf2b5c6a18c6..79dfa257b3b4 100644
> --- a/arch/arm/mach-at91/sama5.c
> +++ b/arch/arm/mach-at91/sama5.c
> @@ -6,14 +6,11 @@
>    *                2013 Ludovic Desroches <ludovic.desroches@atmel.com>
>    */
> 
> -#include <linux/of.h>
> -#include <linux/of_platform.h>
> -
> -#include <asm/hardware/cache-l2x0.h>
>   #include <asm/mach/arch.h>
>   #include <asm/mach/map.h>
>   #include <asm/outercache.h>
>   #include <asm/system_misc.h>
> +#include <asm/hardware/cache-l2x0.h>
> 
>   #include "generic.h"
>   #include "sam_secure.h"
> @@ -32,7 +29,6 @@ static void __init sama5_secure_cache_init(void)
> 
>   static void __init sama5_dt_device_init(void)
>   {
> -       of_platform_default_populate(NULL, NULL, NULL);
>          sama5_pm_init();
>   }
> 
> @@ -61,7 +57,6 @@ MACHINE_END
> 
>   static void __init sama5d2_init(void)
>   {
> -       of_platform_default_populate(NULL, NULL, NULL);
>          sama5d2_pm_init();
>   }
> 
> diff --git a/arch/arm/mach-at91/sama7.c b/arch/arm/mach-at91/sama7.c
> index bd43733ede18..5faccfe9a9bb 100644
> --- a/arch/arm/mach-at91/sama7.c
> +++ b/arch/arm/mach-at91/sama7.c
> @@ -6,9 +6,6 @@
>    *
>    */
> 
> -#include <linux/of.h>
> -#include <linux/of_platform.h>
> -
>   #include <asm/mach/arch.h>
>   #include <asm/system_misc.h>
> 
> @@ -16,7 +13,6 @@
> 
>   static void __init sama7_dt_device_init(void)
>   {
> -       of_platform_default_populate(NULL, NULL, NULL);
>          sama7_pm_init();
>   }
> 
> --
> 2.34.1
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
  

Patch

diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index 4f8186211619..e262f5459c76 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -7,17 +7,12 @@ 
  *                2012 Joachim Eastwood <manabian@gmail.com>
  */
 
-#include <linux/of.h>
-#include <linux/of_platform.h>
-
 #include <asm/mach/arch.h>
 
 #include "generic.h"
 
 static void __init at91rm9200_dt_device_init(void)
 {
-	of_platform_default_populate(NULL, NULL, NULL);
-
 	at91rm9200_pm_init();
 }
 
diff --git a/arch/arm/mach-at91/at91sam9.c b/arch/arm/mach-at91/at91sam9.c
index 7e572189a5eb..74b4dd8403a2 100644
--- a/arch/arm/mach-at91/at91sam9.c
+++ b/arch/arm/mach-at91/at91sam9.c
@@ -6,9 +6,6 @@ 
  *                2011 Nicolas Ferre <nicolas.ferre@atmel.com>
  */
 
-#include <linux/of.h>
-#include <linux/of_platform.h>
-
 #include <asm/mach/arch.h>
 #include <asm/system_misc.h>
 
@@ -16,8 +13,6 @@ 
 
 static void __init at91sam9_init(void)
 {
-	of_platform_default_populate(NULL, NULL, NULL);
-
 	at91sam9_pm_init();
 }
 
diff --git a/arch/arm/mach-at91/sama5.c b/arch/arm/mach-at91/sama5.c
index bf2b5c6a18c6..79dfa257b3b4 100644
--- a/arch/arm/mach-at91/sama5.c
+++ b/arch/arm/mach-at91/sama5.c
@@ -6,14 +6,11 @@ 
  *                2013 Ludovic Desroches <ludovic.desroches@atmel.com>
  */
 
-#include <linux/of.h>
-#include <linux/of_platform.h>
-
-#include <asm/hardware/cache-l2x0.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/outercache.h>
 #include <asm/system_misc.h>
+#include <asm/hardware/cache-l2x0.h>
 
 #include "generic.h"
 #include "sam_secure.h"
@@ -32,7 +29,6 @@  static void __init sama5_secure_cache_init(void)
 
 static void __init sama5_dt_device_init(void)
 {
-	of_platform_default_populate(NULL, NULL, NULL);
 	sama5_pm_init();
 }
 
@@ -61,7 +57,6 @@  MACHINE_END
 
 static void __init sama5d2_init(void)
 {
-	of_platform_default_populate(NULL, NULL, NULL);
 	sama5d2_pm_init();
 }
 
diff --git a/arch/arm/mach-at91/sama7.c b/arch/arm/mach-at91/sama7.c
index bd43733ede18..5faccfe9a9bb 100644
--- a/arch/arm/mach-at91/sama7.c
+++ b/arch/arm/mach-at91/sama7.c
@@ -6,9 +6,6 @@ 
  *
  */
 
-#include <linux/of.h>
-#include <linux/of_platform.h>
-
 #include <asm/mach/arch.h>
 #include <asm/system_misc.h>
 
@@ -16,7 +13,6 @@ 
 
 static void __init sama7_dt_device_init(void)
 {
-	of_platform_default_populate(NULL, NULL, NULL);
 	sama7_pm_init();
 }