Commit 71ce176e authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'dt-fixes-for-3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux

Pull devicetree fixes from Rob Herring:
 - Fix 2 regressions found on PPC
 - Allow NULL ptr in unflatten_and_copy_device_tree
 - Update my email address

* tag 'dt-fixes-for-3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
  MAINTAINERS: Update Rob Herring's email address
  of/irq: Fix device_node refcount in of_irq_parse_raw()
  of/Kconfig: Spelling s/one/once/
  Revert "of/address: Handle #address-cells > 2 specially"
  of: Fix NULL dereference in unflatten_and_copy()
parents 6e4c6196 f0082e3c
...@@ -783,7 +783,7 @@ F: arch/arm/boot/dts/sama*.dts ...@@ -783,7 +783,7 @@ F: arch/arm/boot/dts/sama*.dts
F: arch/arm/boot/dts/sama*.dtsi F: arch/arm/boot/dts/sama*.dtsi
ARM/CALXEDA HIGHBANK ARCHITECTURE ARM/CALXEDA HIGHBANK ARCHITECTURE
M: Rob Herring <rob.herring@calxeda.com> M: Rob Herring <robh@kernel.org>
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
S: Maintained S: Maintained
F: arch/arm/mach-highbank/ F: arch/arm/mach-highbank/
...@@ -6256,7 +6256,7 @@ F: drivers/i2c/busses/i2c-ocores.c ...@@ -6256,7 +6256,7 @@ F: drivers/i2c/busses/i2c-ocores.c
OPEN FIRMWARE AND FLATTENED DEVICE TREE OPEN FIRMWARE AND FLATTENED DEVICE TREE
M: Grant Likely <grant.likely@linaro.org> M: Grant Likely <grant.likely@linaro.org>
M: Rob Herring <rob.herring@calxeda.com> M: Rob Herring <robh+dt@kernel.org>
L: devicetree@vger.kernel.org L: devicetree@vger.kernel.org
W: http://fdt.secretlab.ca W: http://fdt.secretlab.ca
T: git git://git.secretlab.ca/git/linux-2.6.git T: git git://git.secretlab.ca/git/linux-2.6.git
...@@ -6268,7 +6268,7 @@ K: of_get_property ...@@ -6268,7 +6268,7 @@ K: of_get_property
K: of_match_table K: of_match_table
OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS
M: Rob Herring <rob.herring@calxeda.com> M: Rob Herring <robh+dt@kernel.org>
M: Pawel Moll <pawel.moll@arm.com> M: Pawel Moll <pawel.moll@arm.com>
M: Mark Rutland <mark.rutland@arm.com> M: Mark Rutland <mark.rutland@arm.com>
M: Ian Campbell <ijc+devicetree@hellion.org.uk> M: Ian Campbell <ijc+devicetree@hellion.org.uk>
......
...@@ -20,7 +20,7 @@ config OF_SELFTEST ...@@ -20,7 +20,7 @@ config OF_SELFTEST
depends on OF_IRQ depends on OF_IRQ
help help
This option builds in test cases for the device tree infrastructure This option builds in test cases for the device tree infrastructure
that are executed one at boot time, and the results dumped to the that are executed once at boot time, and the results dumped to the
console. console.
If unsure, say N here, but this option is safe to enable. If unsure, say N here, but this option is safe to enable.
......
...@@ -69,14 +69,6 @@ static u64 of_bus_default_map(__be32 *addr, const __be32 *range, ...@@ -69,14 +69,6 @@ static u64 of_bus_default_map(__be32 *addr, const __be32 *range,
(unsigned long long)cp, (unsigned long long)s, (unsigned long long)cp, (unsigned long long)s,
(unsigned long long)da); (unsigned long long)da);
/*
* If the number of address cells is larger than 2 we assume the
* mapping doesn't specify a physical address. Rather, the address
* specifies an identifier that must match exactly.
*/
if (na > 2 && memcmp(range, addr, na * 4) != 0)
return OF_BAD_ADDR;
if (da < cp || da >= (cp + s)) if (da < cp || da >= (cp + s))
return OF_BAD_ADDR; return OF_BAD_ADDR;
return da - cp; return da - cp;
......
...@@ -922,8 +922,16 @@ void __init unflatten_device_tree(void) ...@@ -922,8 +922,16 @@ void __init unflatten_device_tree(void)
*/ */
void __init unflatten_and_copy_device_tree(void) void __init unflatten_and_copy_device_tree(void)
{ {
int size = __be32_to_cpu(initial_boot_params->totalsize); int size;
void *dt = early_init_dt_alloc_memory_arch(size, void *dt;
if (!initial_boot_params) {
pr_warn("No valid device tree found, continuing without\n");
return;
}
size = __be32_to_cpu(initial_boot_params->totalsize);
dt = early_init_dt_alloc_memory_arch(size,
__alignof__(struct boot_param_header)); __alignof__(struct boot_param_header));
if (dt) { if (dt) {
......
...@@ -165,7 +165,6 @@ int of_irq_parse_raw(const __be32 *addr, struct of_phandle_args *out_irq) ...@@ -165,7 +165,6 @@ int of_irq_parse_raw(const __be32 *addr, struct of_phandle_args *out_irq)
if (of_get_property(ipar, "interrupt-controller", NULL) != if (of_get_property(ipar, "interrupt-controller", NULL) !=
NULL) { NULL) {
pr_debug(" -> got it !\n"); pr_debug(" -> got it !\n");
of_node_put(old);
return 0; return 0;
} }
...@@ -250,8 +249,7 @@ int of_irq_parse_raw(const __be32 *addr, struct of_phandle_args *out_irq) ...@@ -250,8 +249,7 @@ int of_irq_parse_raw(const __be32 *addr, struct of_phandle_args *out_irq)
* Successfully parsed an interrrupt-map translation; copy new * Successfully parsed an interrrupt-map translation; copy new
* interrupt specifier into the out_irq structure * interrupt specifier into the out_irq structure
*/ */
of_node_put(out_irq->np); out_irq->np = newpar;
out_irq->np = of_node_get(newpar);
match_array = imap - newaddrsize - newintsize; match_array = imap - newaddrsize - newintsize;
for (i = 0; i < newintsize; i++) for (i = 0; i < newintsize; i++)
...@@ -268,7 +266,6 @@ int of_irq_parse_raw(const __be32 *addr, struct of_phandle_args *out_irq) ...@@ -268,7 +266,6 @@ int of_irq_parse_raw(const __be32 *addr, struct of_phandle_args *out_irq)
} }
fail: fail:
of_node_put(ipar); of_node_put(ipar);
of_node_put(out_irq->np);
of_node_put(newpar); of_node_put(newpar);
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment