diff options
author | Mark Salter <msalter@redhat.com> | 2013-08-26 21:25:49 -0400 |
---|---|---|
committer | Graeme Gregory <graeme.gregory@linaro.org> | 2013-10-21 11:15:04 +0100 |
commit | e7c7266415c9a3a28d85408cdc7d27510348ef56 (patch) | |
tree | 61e52d9cb0b5c7342c62548cff451355049c93de | |
parent | b7c1d86661ef13f88f227e986aad4af8fa2352df (diff) |
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 <msalter@redhat.com>
-rw-r--r-- | drivers/of/fdt.c | 8 |
1 files 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; } |