diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-11-25 17:23:57 -0500 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-11-25 17:23:57 -0500 |
commit | 2a859ab07b6ab66f4134c4fffc341398bd3d328c (patch) | |
tree | c5e7eaf3bffbc18feb326940e39794328d98dc07 /drivers/of | |
parent | cedddd812a79a4fda3885a15711aee3de78c4a24 (diff) | |
parent | e716e014384688d1a50d1aa5213ee74748c6d4e0 (diff) |
Merge branch 'merge' into next
Merge my own merge branch to get various fixes from there
and upstream, especially the hvc console tty refcouting fixes
which which testing is quite a bit harder...
Diffstat (limited to 'drivers/of')
-rw-r--r-- | drivers/of/address.c | 24 | ||||
-rw-r--r-- | drivers/of/irq.c | 8 | ||||
-rw-r--r-- | drivers/of/platform.c | 2 |
3 files changed, 18 insertions, 16 deletions
diff --git a/drivers/of/address.c b/drivers/of/address.c index 72e496f1e9b0..0125524c08c4 100644 --- a/drivers/of/address.c +++ b/drivers/of/address.c | |||
@@ -37,9 +37,9 @@ struct of_bus { | |||
37 | int (*match)(struct device_node *parent); | 37 | int (*match)(struct device_node *parent); |
38 | void (*count_cells)(struct device_node *child, | 38 | void (*count_cells)(struct device_node *child, |
39 | int *addrc, int *sizec); | 39 | int *addrc, int *sizec); |
40 | u64 (*map)(u32 *addr, const __be32 *range, | 40 | u64 (*map)(__be32 *addr, const __be32 *range, |
41 | int na, int ns, int pna); | 41 | int na, int ns, int pna); |
42 | int (*translate)(u32 *addr, u64 offset, int na); | 42 | int (*translate)(__be32 *addr, u64 offset, int na); |
43 | unsigned int (*get_flags)(const __be32 *addr); | 43 | unsigned int (*get_flags)(const __be32 *addr); |
44 | }; | 44 | }; |
45 | 45 | ||
@@ -56,7 +56,7 @@ static void of_bus_default_count_cells(struct device_node *dev, | |||
56 | *sizec = of_n_size_cells(dev); | 56 | *sizec = of_n_size_cells(dev); |
57 | } | 57 | } |
58 | 58 | ||
59 | static u64 of_bus_default_map(u32 *addr, const __be32 *range, | 59 | static u64 of_bus_default_map(__be32 *addr, const __be32 *range, |
60 | int na, int ns, int pna) | 60 | int na, int ns, int pna) |
61 | { | 61 | { |
62 | u64 cp, s, da; | 62 | u64 cp, s, da; |
@@ -82,7 +82,7 @@ static u64 of_bus_default_map(u32 *addr, const __be32 *range, | |||
82 | return da - cp; | 82 | return da - cp; |
83 | } | 83 | } |
84 | 84 | ||
85 | static int of_bus_default_translate(u32 *addr, u64 offset, int na) | 85 | static int of_bus_default_translate(__be32 *addr, u64 offset, int na) |
86 | { | 86 | { |
87 | u64 a = of_read_number(addr, na); | 87 | u64 a = of_read_number(addr, na); |
88 | memset(addr, 0, na * 4); | 88 | memset(addr, 0, na * 4); |
@@ -138,7 +138,7 @@ static unsigned int of_bus_pci_get_flags(const __be32 *addr) | |||
138 | return flags; | 138 | return flags; |
139 | } | 139 | } |
140 | 140 | ||
141 | static u64 of_bus_pci_map(u32 *addr, const __be32 *range, int na, int ns, | 141 | static u64 of_bus_pci_map(__be32 *addr, const __be32 *range, int na, int ns, |
142 | int pna) | 142 | int pna) |
143 | { | 143 | { |
144 | u64 cp, s, da; | 144 | u64 cp, s, da; |
@@ -165,7 +165,7 @@ static u64 of_bus_pci_map(u32 *addr, const __be32 *range, int na, int ns, | |||
165 | return da - cp; | 165 | return da - cp; |
166 | } | 166 | } |
167 | 167 | ||
168 | static int of_bus_pci_translate(u32 *addr, u64 offset, int na) | 168 | static int of_bus_pci_translate(__be32 *addr, u64 offset, int na) |
169 | { | 169 | { |
170 | return of_bus_default_translate(addr + 1, offset, na - 1); | 170 | return of_bus_default_translate(addr + 1, offset, na - 1); |
171 | } | 171 | } |
@@ -247,7 +247,7 @@ static void of_bus_isa_count_cells(struct device_node *child, | |||
247 | *sizec = 1; | 247 | *sizec = 1; |
248 | } | 248 | } |
249 | 249 | ||
250 | static u64 of_bus_isa_map(u32 *addr, const __be32 *range, int na, int ns, | 250 | static u64 of_bus_isa_map(__be32 *addr, const __be32 *range, int na, int ns, |
251 | int pna) | 251 | int pna) |
252 | { | 252 | { |
253 | u64 cp, s, da; | 253 | u64 cp, s, da; |
@@ -270,7 +270,7 @@ static u64 of_bus_isa_map(u32 *addr, const __be32 *range, int na, int ns, | |||
270 | return da - cp; | 270 | return da - cp; |
271 | } | 271 | } |
272 | 272 | ||
273 | static int of_bus_isa_translate(u32 *addr, u64 offset, int na) | 273 | static int of_bus_isa_translate(__be32 *addr, u64 offset, int na) |
274 | { | 274 | { |
275 | return of_bus_default_translate(addr + 1, offset, na - 1); | 275 | return of_bus_default_translate(addr + 1, offset, na - 1); |
276 | } | 276 | } |
@@ -338,7 +338,7 @@ static struct of_bus *of_match_bus(struct device_node *np) | |||
338 | } | 338 | } |
339 | 339 | ||
340 | static int of_translate_one(struct device_node *parent, struct of_bus *bus, | 340 | static int of_translate_one(struct device_node *parent, struct of_bus *bus, |
341 | struct of_bus *pbus, u32 *addr, | 341 | struct of_bus *pbus, __be32 *addr, |
342 | int na, int ns, int pna, const char *rprop) | 342 | int na, int ns, int pna, const char *rprop) |
343 | { | 343 | { |
344 | const __be32 *ranges; | 344 | const __be32 *ranges; |
@@ -409,12 +409,12 @@ static int of_translate_one(struct device_node *parent, struct of_bus *bus, | |||
409 | * that can be mapped to a cpu physical address). This is not really specified | 409 | * that can be mapped to a cpu physical address). This is not really specified |
410 | * that way, but this is traditionally the way IBM at least do things | 410 | * that way, but this is traditionally the way IBM at least do things |
411 | */ | 411 | */ |
412 | u64 __of_translate_address(struct device_node *dev, const __be32 *in_addr, | 412 | static u64 __of_translate_address(struct device_node *dev, |
413 | const char *rprop) | 413 | const __be32 *in_addr, const char *rprop) |
414 | { | 414 | { |
415 | struct device_node *parent = NULL; | 415 | struct device_node *parent = NULL; |
416 | struct of_bus *bus, *pbus; | 416 | struct of_bus *bus, *pbus; |
417 | u32 addr[OF_MAX_ADDR_CELLS]; | 417 | __be32 addr[OF_MAX_ADDR_CELLS]; |
418 | int na, ns, pna, pns; | 418 | int na, ns, pna, pns; |
419 | u64 result = OF_BAD_ADDR; | 419 | u64 result = OF_BAD_ADDR; |
420 | 420 | ||
diff --git a/drivers/of/irq.c b/drivers/of/irq.c index a23ec7779997..a3c1c5aae6a9 100644 --- a/drivers/of/irq.c +++ b/drivers/of/irq.c | |||
@@ -192,11 +192,13 @@ int of_irq_map_raw(struct device_node *parent, const __be32 *intspec, | |||
192 | /* Compare specifiers */ | 192 | /* Compare specifiers */ |
193 | match = 1; | 193 | match = 1; |
194 | for (i = 0; i < addrsize && match; ++i) { | 194 | for (i = 0; i < addrsize && match; ++i) { |
195 | u32 mask = imask ? imask[i] : 0xffffffffu; | 195 | __be32 mask = imask ? imask[i] |
196 | : cpu_to_be32(0xffffffffu); | ||
196 | match = ((addr[i] ^ imap[i]) & mask) == 0; | 197 | match = ((addr[i] ^ imap[i]) & mask) == 0; |
197 | } | 198 | } |
198 | for (; i < (addrsize + intsize) && match; ++i) { | 199 | for (; i < (addrsize + intsize) && match; ++i) { |
199 | u32 mask = imask ? imask[i] : 0xffffffffu; | 200 | __be32 mask = imask ? imask[i] |
201 | : cpu_to_be32(0xffffffffu); | ||
200 | match = | 202 | match = |
201 | ((intspec[i-addrsize] ^ imap[i]) & mask) == 0; | 203 | ((intspec[i-addrsize] ^ imap[i]) & mask) == 0; |
202 | } | 204 | } |
@@ -465,7 +467,7 @@ void __init of_irq_init(const struct of_device_id *matches) | |||
465 | pr_debug("of_irq_init: init %s @ %p, parent %p\n", | 467 | pr_debug("of_irq_init: init %s @ %p, parent %p\n", |
466 | match->compatible, | 468 | match->compatible, |
467 | desc->dev, desc->interrupt_parent); | 469 | desc->dev, desc->interrupt_parent); |
468 | irq_init_cb = match->data; | 470 | irq_init_cb = (of_irq_init_cb_t)match->data; |
469 | ret = irq_init_cb(desc->dev, desc->interrupt_parent); | 471 | ret = irq_init_cb(desc->dev, desc->interrupt_parent); |
470 | if (ret) { | 472 | if (ret) { |
471 | kfree(desc); | 473 | kfree(desc); |
diff --git a/drivers/of/platform.c b/drivers/of/platform.c index 9bdeaf30b17d..b80891b43816 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c | |||
@@ -76,7 +76,7 @@ void of_device_make_bus_id(struct device *dev) | |||
76 | { | 76 | { |
77 | static atomic_t bus_no_reg_magic; | 77 | static atomic_t bus_no_reg_magic; |
78 | struct device_node *node = dev->of_node; | 78 | struct device_node *node = dev->of_node; |
79 | const u32 *reg; | 79 | const __be32 *reg; |
80 | u64 addr; | 80 | u64 addr; |
81 | const __be32 *addrp; | 81 | const __be32 *addrp; |
82 | int magic; | 82 | int magic; |