[PATCH v2 08/21] ARM: Layerscape: icid: use of_property_write_u32_array() in of_set_qportal_iommu_prop()

Sascha Hauer s.hauer at pengutronix.de
Tue Jan 9 08:15:14 PST 2024


Use of_property_write_u32_array() rather than of_set_property()
to make the code a bit clearer.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 arch/arm/mach-layerscape/icid.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/arch/arm/mach-layerscape/icid.c b/arch/arm/mach-layerscape/icid.c
index 2e0b4a64df..1055cf59da 100644
--- a/arch/arm/mach-layerscape/icid.c
+++ b/arch/arm/mach-layerscape/icid.c
@@ -496,16 +496,16 @@ static void setup_qbman_portals(void)
 static void of_set_qportal_iommu_prop(struct device_node *np, phandle iommu_handle,
 			       const struct qportal_info *qp_info)
 {
-	u32 prop[6];
-
-	prop[0] = cpu_to_fdt32(iommu_handle);
-	prop[1] = cpu_to_fdt32(qp_info->icid);
-	prop[2] = cpu_to_fdt32(iommu_handle);
-	prop[3] = cpu_to_fdt32(qp_info->dicid);
-	prop[4] = cpu_to_fdt32(iommu_handle);
-	prop[5] = cpu_to_fdt32(qp_info->ficid);
+	u32 prop[] = {
+		iommu_handle,
+		qp_info->icid,
+		iommu_handle,
+		qp_info->dicid,
+		iommu_handle,
+		qp_info->ficid
+	};
 
-	of_set_property(np, "iommus", prop, sizeof(prop), 1);
+	of_property_write_u32_array(np, "iommus", prop, ARRAY_SIZE(prop));
 }
 
 static void of_fixup_qportals(struct device_node *root, phandle iommu_handle)
-- 
2.39.2




More information about the barebox mailing list