Skip to contentSkip to conversation

ARM: orion5x: update board check in mss2_pci_init() to use the DT

PATCH In review Ethan Nelson-Moore 2 participants 2 messages May 17 – Jun 1

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 ARM: orion5x: update board check in mss2_pci_init() to use the DT

The mss2_pci_init() function contains a check for the ARM machine ID via the machine_is_mss2() macro. The board concerned now supports only FDT booting, which does not use machine IDs, and therefore the code should be updated to check the DT compatible property instead. The machine was converted to FDT booting in commit fbf04d814d0a ("ARM:
orion5x: convert Maxtor Shared Storage II to the Device Tree"). The presence of this machine ID check prevents the removal of machine IDs no longer used by the kernel from arch/arm/tools/mach-types, because the machine_is_*() macros are generated from mach-types. To resolve this issue, use of_machine_is_compatible() instead.

---
Changes from v1: Fix mistake in commit message and remove Fixes tag - machine ID checks still work with DT booting if the bootloader passes the ID
Changes from v2: correct changelog formatting (there were two --- sections in v2)

 arch/arm/mach-orion5x/board-mss2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-orion5x/board-mss2.c +2 -2
index 9e3d69891d2f..322ae29d05aa 100644
@@ -10,7 +10,7 @@
 #include <linux/platform_device.h>
 #include <linux/pci.h>
 #include <linux/irq.h>
-#include <asm/mach-types.h>
+#include <linux/of.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/pci.h>
 #include "orion5x.h"
@@ -47,7 +47,7 @@ static struct hw_pci mss2_pci __initdata = {
 
 static int __init mss2_pci_init(void)
 {
-	if (machine_is_mss2())
+	if (of_machine_is_compatible("maxtor,shared-storage-2"))
 		pci_common_init(&mss2_pci);
 
 	return 0;
Signature · 1 line
2.43.0
maintainer
#1 lore raw
Quoted 11 lines · Ethan Nelson-Moore

The mss2_pci_init() function contains a check for the ARM machine ID via the machine_is_mss2() macro. The board concerned now supports only FDT booting, which does not use machine IDs, and therefore the code should be updated to check the DT compatible property instead. The machine was converted to FDT booting in commit fbf04d814d0a ("ARM:
orion5x: convert Maxtor Shared Storage II to the Device Tree"). The presence of this machine ID check prevents the removal of machine IDs no longer used by the kernel from arch/arm/tools/mach-types, because the machine_is_*() macros are generated from mach-types. To resolve this issue, use of_machine_is_compatible() instead.

Quoted 8 lines

---
Changes from v1: Fix mistake in commit message and remove Fixes tag - machine ID checks still work with DT booting if the bootloader passes the ID
Changes from v2: correct changelog formatting (there were two --- sections in v2)

Applied on mvebu/arm

Thanks,

Gregory

Quoted 28 lines
 arch/arm/mach-orion5x/board-mss2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-orion5x/board-mss2.c +2 -2
index 9e3d69891d2f..322ae29d05aa 100644
@@ -10,7 +10,7 @@
 #include <linux/platform_device.h>
 #include <linux/pci.h>
 #include <linux/irq.h>
-#include <asm/mach-types.h>
+#include <linux/of.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/pci.h>
 #include "orion5x.h"
@@ -47,7 +47,7 @@ static struct hw_pci mss2_pci __initdata = {
 
 static int __init mss2_pci_init(void)
 {
-	if (machine_is_mss2())
+	if (of_machine_is_compatible("maxtor,shared-storage-2"))
 		pci_common_init(&mss2_pci);
 
 	return 0;
Signature · 1 line
2.43.0
Signature · 3 lines
Grégory CLEMENT, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com