From e7c7266415c9a3a28d85408cdc7d27510348ef56 Mon Sep 17 00:00:00 2001 From: Mark Salter Date: Mon, 26 Aug 2013 21:25:49 -0400 Subject: of: fix fdt parsing of acpi blob addr/size for arm64 The early_init_dt_scan_acpi() function currently uses be32_to_cpu() helpers to read the "linux,acpi-start" and "linux,acpi-len" properties. This may not be safe for arm64. This patch uses of_read_ulong to read the property values which should be safe for both arm and arm64. Signed-off-by: Mark Salter --- drivers/of/fdt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 6d9dd635ce80..d1d17e05bf3d 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -809,13 +809,13 @@ int __init early_init_dt_scan_acpi(unsigned long node, const char *uname, /* Retrieve acpi,address line */ pinfo = (struct acpi_arm_root *)data; p = of_get_flat_dt_prop(node, "linux,acpi-start", &l); - if (p != NULL && l > 0) - pinfo->phys_address = be32_to_cpu(*p); + if (p) + pinfo->phys_address = of_read_ulong(p, l/4); /* Retrieve acpi,size line */ p = of_get_flat_dt_prop(node, "linux,acpi-len", &l); - if (p != NULL && l > 0) - pinfo->size = be32_to_cpu(*p); + if (p) + pinfo->size = of_read_ulong(p, l/4); return 1; } -- cgit v1.2.3