aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/of
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2014-01-17 17:01:27 -0500
committerRob Herring <robh@kernel.org>2014-01-17 17:01:27 -0500
commit361128fcbf30f590a05c8e8789155364f37367db (patch)
tree7f7973599e286dfd48ea724a5b7fb4bca76b294e /drivers/of
parente2897d7e0b0460dca91b52d55ce41c888363502d (diff)
parent482c43419fc204b4b658fa4acb80cd502e5fcbac (diff)
Merge remote-tracking branch 'grant/devicetree/next' into for-3.14
Diffstat (limited to 'drivers/of')
-rw-r--r--drivers/of/Kconfig2
-rw-r--r--drivers/of/address.c8
-rw-r--r--drivers/of/fdt.c12
-rw-r--r--drivers/of/irq.c5
4 files changed, 12 insertions, 15 deletions
diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig
index de6f8990246f..c6973f101a3e 100644
--- a/drivers/of/Kconfig
+++ b/drivers/of/Kconfig
@@ -20,7 +20,7 @@ config OF_SELFTEST
20 depends on OF_IRQ 20 depends on OF_IRQ
21 help 21 help
22 This option builds in test cases for the device tree infrastructure 22 This option builds in test cases for the device tree infrastructure
23 that are executed one at boot time, and the results dumped to the 23 that are executed once at boot time, and the results dumped to the
24 console. 24 console.
25 25
26 If unsure, say N here, but this option is safe to enable. 26 If unsure, say N here, but this option is safe to enable.
diff --git a/drivers/of/address.c b/drivers/of/address.c
index 4b9317bdb81c..d3dd41c840f1 100644
--- a/drivers/of/address.c
+++ b/drivers/of/address.c
@@ -69,14 +69,6 @@ static u64 of_bus_default_map(__be32 *addr, const __be32 *range,
69 (unsigned long long)cp, (unsigned long long)s, 69 (unsigned long long)cp, (unsigned long long)s,
70 (unsigned long long)da); 70 (unsigned long long)da);
71 71
72 /*
73 * If the number of address cells is larger than 2 we assume the
74 * mapping doesn't specify a physical address. Rather, the address
75 * specifies an identifier that must match exactly.
76 */
77 if (na > 2 && memcmp(range, addr, na * 4) != 0)
78 return OF_BAD_ADDR;
79
80 if (da < cp || da >= (cp + s)) 72 if (da < cp || da >= (cp + s))
81 return OF_BAD_ADDR; 73 return OF_BAD_ADDR;
82 return da - cp; 74 return da - cp;
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index 2fa024b97c43..758b4f8b30b7 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -922,8 +922,16 @@ void __init unflatten_device_tree(void)
922 */ 922 */
923void __init unflatten_and_copy_device_tree(void) 923void __init unflatten_and_copy_device_tree(void)
924{ 924{
925 int size = __be32_to_cpu(initial_boot_params->totalsize); 925 int size;
926 void *dt = early_init_dt_alloc_memory_arch(size, 926 void *dt;
927
928 if (!initial_boot_params) {
929 pr_warn("No valid device tree found, continuing without\n");
930 return;
931 }
932
933 size = __be32_to_cpu(initial_boot_params->totalsize);
934 dt = early_init_dt_alloc_memory_arch(size,
927 __alignof__(struct boot_param_header)); 935 __alignof__(struct boot_param_header));
928 936
929 if (dt) { 937 if (dt) {
diff --git a/drivers/of/irq.c b/drivers/of/irq.c
index bf8026895c5e..9bcf2cf19357 100644
--- a/drivers/of/irq.c
+++ b/drivers/of/irq.c
@@ -165,7 +165,6 @@ int of_irq_parse_raw(const __be32 *addr, struct of_phandle_args *out_irq)
165 if (of_get_property(ipar, "interrupt-controller", NULL) != 165 if (of_get_property(ipar, "interrupt-controller", NULL) !=
166 NULL) { 166 NULL) {
167 pr_debug(" -> got it !\n"); 167 pr_debug(" -> got it !\n");
168 of_node_put(old);
169 return 0; 168 return 0;
170 } 169 }
171 170
@@ -253,8 +252,7 @@ int of_irq_parse_raw(const __be32 *addr, struct of_phandle_args *out_irq)
253 * Successfully parsed an interrrupt-map translation; copy new 252 * Successfully parsed an interrrupt-map translation; copy new
254 * interrupt specifier into the out_irq structure 253 * interrupt specifier into the out_irq structure
255 */ 254 */
256 of_node_put(out_irq->np); 255 out_irq->np = newpar;
257 out_irq->np = of_node_get(newpar);
258 256
259 match_array = imap - newaddrsize - newintsize; 257 match_array = imap - newaddrsize - newintsize;
260 for (i = 0; i < newintsize; i++) 258 for (i = 0; i < newintsize; i++)
@@ -271,7 +269,6 @@ int of_irq_parse_raw(const __be32 *addr, struct of_phandle_args *out_irq)
271 } 269 }
272 fail: 270 fail:
273 of_node_put(ipar); 271 of_node_put(ipar);
274 of_node_put(out_irq->np);
275 of_node_put(newpar); 272 of_node_put(newpar);
276 273
277 return -EINVAL; 274 return -EINVAL;