diff options
author | Kyle Moffett <Kyle.D.Moffett@boeing.com> | 2011-12-02 01:27:59 -0500 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2011-12-06 21:43:06 -0500 |
commit | 8bf41568969e003c3d5410124e27bbdce7852e1b (patch) | |
tree | 684fee8aa54797e2482afd66b94f9633fcbd5061 /arch/powerpc/platforms | |
parent | 582d3e099413c3741a88bdee9e3ff3cc2f9d3329 (diff) |
powerpc: Consolidate mpic_alloc() OF address translation
Instead of using the open-coded "reg" property lookup and address
translation in mpic_alloc(), directly call of_address_to_resource().
This includes various workarounds for special cases which the naive
of_address_translate() does not.
Afterwards it is possible to remove the copiously copy-pasted calls to
of_address_translate() from the 85xx/86xx/powermac platforms.
Signed-off-by: Kyle Moffett <Kyle.D.Moffett@boeing.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r-- | arch/powerpc/platforms/85xx/corenet_ds.c | 9 | ||||
-rw-r--r-- | arch/powerpc/platforms/85xx/ksi8560.c | 9 | ||||
-rw-r--r-- | arch/powerpc/platforms/85xx/mpc8536_ds.c | 9 | ||||
-rw-r--r-- | arch/powerpc/platforms/85xx/mpc85xx_ads.c | 9 | ||||
-rw-r--r-- | arch/powerpc/platforms/85xx/mpc85xx_cds.c | 9 | ||||
-rw-r--r-- | arch/powerpc/platforms/85xx/mpc85xx_ds.c | 11 | ||||
-rw-r--r-- | arch/powerpc/platforms/85xx/mpc85xx_mds.c | 9 | ||||
-rw-r--r-- | arch/powerpc/platforms/85xx/mpc85xx_rdb.c | 11 | ||||
-rw-r--r-- | arch/powerpc/platforms/85xx/p1010rdb.c | 9 | ||||
-rw-r--r-- | arch/powerpc/platforms/85xx/p1022_ds.c | 9 | ||||
-rw-r--r-- | arch/powerpc/platforms/85xx/p1023_rds.c | 9 | ||||
-rw-r--r-- | arch/powerpc/platforms/85xx/sbc8548.c | 9 | ||||
-rw-r--r-- | arch/powerpc/platforms/85xx/sbc8560.c | 9 | ||||
-rw-r--r-- | arch/powerpc/platforms/85xx/socrates.c | 9 | ||||
-rw-r--r-- | arch/powerpc/platforms/85xx/stx_gp3.c | 9 | ||||
-rw-r--r-- | arch/powerpc/platforms/85xx/tqm85xx.c | 9 | ||||
-rw-r--r-- | arch/powerpc/platforms/85xx/xes_mpc85xx.c | 9 | ||||
-rw-r--r-- | arch/powerpc/platforms/86xx/pic.c | 4 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/pic.c | 8 |
19 files changed, 21 insertions, 148 deletions
diff --git a/arch/powerpc/platforms/85xx/corenet_ds.c b/arch/powerpc/platforms/85xx/corenet_ds.c index 30528219b27..5b1c577199b 100644 --- a/arch/powerpc/platforms/85xx/corenet_ds.c +++ b/arch/powerpc/platforms/85xx/corenet_ds.c | |||
@@ -36,7 +36,6 @@ | |||
36 | void __init corenet_ds_pic_init(void) | 36 | void __init corenet_ds_pic_init(void) |
37 | { | 37 | { |
38 | struct mpic *mpic; | 38 | struct mpic *mpic; |
39 | struct resource r; | ||
40 | struct device_node *np = NULL; | 39 | struct device_node *np = NULL; |
41 | unsigned int flags = MPIC_PRIMARY | MPIC_BIG_ENDIAN | | 40 | unsigned int flags = MPIC_PRIMARY | MPIC_BIG_ENDIAN | |
42 | MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU; | 41 | MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU; |
@@ -48,16 +47,10 @@ void __init corenet_ds_pic_init(void) | |||
48 | return; | 47 | return; |
49 | } | 48 | } |
50 | 49 | ||
51 | if (of_address_to_resource(np, 0, &r)) { | ||
52 | printk(KERN_ERR "Failed to map mpic register space\n"); | ||
53 | of_node_put(np); | ||
54 | return; | ||
55 | } | ||
56 | |||
57 | if (ppc_md.get_irq == mpic_get_coreint_irq) | 50 | if (ppc_md.get_irq == mpic_get_coreint_irq) |
58 | flags |= MPIC_ENABLE_COREINT; | 51 | flags |= MPIC_ENABLE_COREINT; |
59 | 52 | ||
60 | mpic = mpic_alloc(np, r.start, flags, 0, 256, " OpenPIC "); | 53 | mpic = mpic_alloc(np, 0, flags, 0, 256, " OpenPIC "); |
61 | BUG_ON(mpic == NULL); | 54 | BUG_ON(mpic == NULL); |
62 | 55 | ||
63 | mpic_init(mpic); | 56 | mpic_init(mpic); |
diff --git a/arch/powerpc/platforms/85xx/ksi8560.c b/arch/powerpc/platforms/85xx/ksi8560.c index 0f3e6883265..3403b0e0143 100644 --- a/arch/powerpc/platforms/85xx/ksi8560.c +++ b/arch/powerpc/platforms/85xx/ksi8560.c | |||
@@ -58,7 +58,6 @@ static void machine_restart(char *cmd) | |||
58 | static void __init ksi8560_pic_init(void) | 58 | static void __init ksi8560_pic_init(void) |
59 | { | 59 | { |
60 | struct mpic *mpic; | 60 | struct mpic *mpic; |
61 | struct resource r; | ||
62 | struct device_node *np; | 61 | struct device_node *np; |
63 | 62 | ||
64 | np = of_find_node_by_type(NULL, "open-pic"); | 63 | np = of_find_node_by_type(NULL, "open-pic"); |
@@ -68,13 +67,7 @@ static void __init ksi8560_pic_init(void) | |||
68 | return; | 67 | return; |
69 | } | 68 | } |
70 | 69 | ||
71 | if (of_address_to_resource(np, 0, &r)) { | 70 | mpic = mpic_alloc(np, 0, |
72 | printk(KERN_ERR "Could not map mpic register space\n"); | ||
73 | of_node_put(np); | ||
74 | return; | ||
75 | } | ||
76 | |||
77 | mpic = mpic_alloc(np, r.start, | ||
78 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, | 71 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, |
79 | 0, 256, " OpenPIC "); | 72 | 0, 256, " OpenPIC "); |
80 | BUG_ON(mpic == NULL); | 73 | BUG_ON(mpic == NULL); |
diff --git a/arch/powerpc/platforms/85xx/mpc8536_ds.c b/arch/powerpc/platforms/85xx/mpc8536_ds.c index 9ee6455c2f1..5c20b28568b 100644 --- a/arch/powerpc/platforms/85xx/mpc8536_ds.c +++ b/arch/powerpc/platforms/85xx/mpc8536_ds.c | |||
@@ -37,7 +37,6 @@ | |||
37 | void __init mpc8536_ds_pic_init(void) | 37 | void __init mpc8536_ds_pic_init(void) |
38 | { | 38 | { |
39 | struct mpic *mpic; | 39 | struct mpic *mpic; |
40 | struct resource r; | ||
41 | struct device_node *np; | 40 | struct device_node *np; |
42 | 41 | ||
43 | np = of_find_node_by_type(NULL, "open-pic"); | 42 | np = of_find_node_by_type(NULL, "open-pic"); |
@@ -46,13 +45,7 @@ void __init mpc8536_ds_pic_init(void) | |||
46 | return; | 45 | return; |
47 | } | 46 | } |
48 | 47 | ||
49 | if (of_address_to_resource(np, 0, &r)) { | 48 | mpic = mpic_alloc(np, 0, |
50 | printk(KERN_ERR "Failed to map mpic register space\n"); | ||
51 | of_node_put(np); | ||
52 | return; | ||
53 | } | ||
54 | |||
55 | mpic = mpic_alloc(np, r.start, | ||
56 | MPIC_PRIMARY | MPIC_WANTS_RESET | | 49 | MPIC_PRIMARY | MPIC_WANTS_RESET | |
57 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS, | 50 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS, |
58 | 0, 256, " OpenPIC "); | 51 | 0, 256, " OpenPIC "); |
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c b/arch/powerpc/platforms/85xx/mpc85xx_ads.c index 986554b74d3..4c1e9b67ac5 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c | |||
@@ -51,7 +51,6 @@ static int mpc85xx_exclude_device(struct pci_controller *hose, | |||
51 | static void __init mpc85xx_ads_pic_init(void) | 51 | static void __init mpc85xx_ads_pic_init(void) |
52 | { | 52 | { |
53 | struct mpic *mpic; | 53 | struct mpic *mpic; |
54 | struct resource r; | ||
55 | struct device_node *np = NULL; | 54 | struct device_node *np = NULL; |
56 | 55 | ||
57 | np = of_find_node_by_type(np, "open-pic"); | 56 | np = of_find_node_by_type(np, "open-pic"); |
@@ -60,13 +59,7 @@ static void __init mpc85xx_ads_pic_init(void) | |||
60 | return; | 59 | return; |
61 | } | 60 | } |
62 | 61 | ||
63 | if (of_address_to_resource(np, 0, &r)) { | 62 | mpic = mpic_alloc(np, 0, |
64 | printk(KERN_ERR "Could not map mpic register space\n"); | ||
65 | of_node_put(np); | ||
66 | return; | ||
67 | } | ||
68 | |||
69 | mpic = mpic_alloc(np, r.start, | ||
70 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, | 63 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, |
71 | 0, 256, " OpenPIC "); | 64 | 0, 256, " OpenPIC "); |
72 | BUG_ON(mpic == NULL); | 65 | BUG_ON(mpic == NULL); |
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c index d993b66f1ab..62b90c35969 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c | |||
@@ -188,7 +188,6 @@ static struct irqaction mpc85xxcds_8259_irqaction = { | |||
188 | static void __init mpc85xx_cds_pic_init(void) | 188 | static void __init mpc85xx_cds_pic_init(void) |
189 | { | 189 | { |
190 | struct mpic *mpic; | 190 | struct mpic *mpic; |
191 | struct resource r; | ||
192 | struct device_node *np = NULL; | 191 | struct device_node *np = NULL; |
193 | 192 | ||
194 | np = of_find_node_by_type(np, "open-pic"); | 193 | np = of_find_node_by_type(np, "open-pic"); |
@@ -198,13 +197,7 @@ static void __init mpc85xx_cds_pic_init(void) | |||
198 | return; | 197 | return; |
199 | } | 198 | } |
200 | 199 | ||
201 | if (of_address_to_resource(np, 0, &r)) { | 200 | mpic = mpic_alloc(np, 0, |
202 | printk(KERN_ERR "Failed to map mpic register space\n"); | ||
203 | of_node_put(np); | ||
204 | return; | ||
205 | } | ||
206 | |||
207 | mpic = mpic_alloc(np, r.start, | ||
208 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, | 201 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, |
209 | 0, 256, " OpenPIC "); | 202 | 0, 256, " OpenPIC "); |
210 | BUG_ON(mpic == NULL); | 203 | BUG_ON(mpic == NULL); |
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c b/arch/powerpc/platforms/85xx/mpc85xx_ds.c index 3f66631103c..4fc6b801c55 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c | |||
@@ -63,7 +63,6 @@ static void mpc85xx_8259_cascade(unsigned int irq, struct irq_desc *desc) | |||
63 | void __init mpc85xx_ds_pic_init(void) | 63 | void __init mpc85xx_ds_pic_init(void) |
64 | { | 64 | { |
65 | struct mpic *mpic; | 65 | struct mpic *mpic; |
66 | struct resource r; | ||
67 | struct device_node *np; | 66 | struct device_node *np; |
68 | #ifdef CONFIG_PPC_I8259 | 67 | #ifdef CONFIG_PPC_I8259 |
69 | struct device_node *cascade_node = NULL; | 68 | struct device_node *cascade_node = NULL; |
@@ -77,20 +76,14 @@ void __init mpc85xx_ds_pic_init(void) | |||
77 | return; | 76 | return; |
78 | } | 77 | } |
79 | 78 | ||
80 | if (of_address_to_resource(np, 0, &r)) { | ||
81 | printk(KERN_ERR "Failed to map mpic register space\n"); | ||
82 | of_node_put(np); | ||
83 | return; | ||
84 | } | ||
85 | |||
86 | if (of_flat_dt_is_compatible(root, "fsl,MPC8572DS-CAMP")) { | 79 | if (of_flat_dt_is_compatible(root, "fsl,MPC8572DS-CAMP")) { |
87 | mpic = mpic_alloc(np, r.start, | 80 | mpic = mpic_alloc(np, 0, |
88 | MPIC_PRIMARY | | 81 | MPIC_PRIMARY | |
89 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | | 82 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | |
90 | MPIC_SINGLE_DEST_CPU, | 83 | MPIC_SINGLE_DEST_CPU, |
91 | 0, 256, " OpenPIC "); | 84 | 0, 256, " OpenPIC "); |
92 | } else { | 85 | } else { |
93 | mpic = mpic_alloc(np, r.start, | 86 | mpic = mpic_alloc(np, 0, |
94 | MPIC_PRIMARY | MPIC_WANTS_RESET | | 87 | MPIC_PRIMARY | MPIC_WANTS_RESET | |
95 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | | 88 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | |
96 | MPIC_SINGLE_DEST_CPU, | 89 | MPIC_SINGLE_DEST_CPU, |
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c index 813b5d3a435..74b6da2e087 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c | |||
@@ -435,20 +435,13 @@ machine_arch_initcall(p1021_mds, swiotlb_setup_bus_notifier); | |||
435 | static void __init mpc85xx_mds_pic_init(void) | 435 | static void __init mpc85xx_mds_pic_init(void) |
436 | { | 436 | { |
437 | struct mpic *mpic; | 437 | struct mpic *mpic; |
438 | struct resource r; | ||
439 | struct device_node *np = NULL; | 438 | struct device_node *np = NULL; |
440 | 439 | ||
441 | np = of_find_node_by_type(NULL, "open-pic"); | 440 | np = of_find_node_by_type(NULL, "open-pic"); |
442 | if (!np) | 441 | if (!np) |
443 | return; | 442 | return; |
444 | 443 | ||
445 | if (of_address_to_resource(np, 0, &r)) { | 444 | mpic = mpic_alloc(np, 0, |
446 | printk(KERN_ERR "Failed to map mpic register space\n"); | ||
447 | of_node_put(np); | ||
448 | return; | ||
449 | } | ||
450 | |||
451 | mpic = mpic_alloc(np, r.start, | ||
452 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN | | 445 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN | |
453 | MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU, | 446 | MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU, |
454 | 0, 256, " OpenPIC "); | 447 | 0, 256, " OpenPIC "); |
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c index b1ca429a515..2b299eba367 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c | |||
@@ -45,7 +45,6 @@ | |||
45 | void __init mpc85xx_rdb_pic_init(void) | 45 | void __init mpc85xx_rdb_pic_init(void) |
46 | { | 46 | { |
47 | struct mpic *mpic; | 47 | struct mpic *mpic; |
48 | struct resource r; | ||
49 | struct device_node *np; | 48 | struct device_node *np; |
50 | unsigned long root = of_get_flat_dt_root(); | 49 | unsigned long root = of_get_flat_dt_root(); |
51 | 50 | ||
@@ -55,20 +54,14 @@ void __init mpc85xx_rdb_pic_init(void) | |||
55 | return; | 54 | return; |
56 | } | 55 | } |
57 | 56 | ||
58 | if (of_address_to_resource(np, 0, &r)) { | ||
59 | printk(KERN_ERR "Failed to map mpic register space\n"); | ||
60 | of_node_put(np); | ||
61 | return; | ||
62 | } | ||
63 | |||
64 | if (of_flat_dt_is_compatible(root, "fsl,MPC85XXRDB-CAMP")) { | 57 | if (of_flat_dt_is_compatible(root, "fsl,MPC85XXRDB-CAMP")) { |
65 | mpic = mpic_alloc(np, r.start, | 58 | mpic = mpic_alloc(np, 0, |
66 | MPIC_PRIMARY | | 59 | MPIC_PRIMARY | |
67 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | | 60 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | |
68 | MPIC_SINGLE_DEST_CPU, | 61 | MPIC_SINGLE_DEST_CPU, |
69 | 0, 256, " OpenPIC "); | 62 | 0, 256, " OpenPIC "); |
70 | } else { | 63 | } else { |
71 | mpic = mpic_alloc(np, r.start, | 64 | mpic = mpic_alloc(np, 0, |
72 | MPIC_PRIMARY | MPIC_WANTS_RESET | | 65 | MPIC_PRIMARY | MPIC_WANTS_RESET | |
73 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | | 66 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | |
74 | MPIC_SINGLE_DEST_CPU, | 67 | MPIC_SINGLE_DEST_CPU, |
diff --git a/arch/powerpc/platforms/85xx/p1010rdb.c b/arch/powerpc/platforms/85xx/p1010rdb.c index 2f479f88c1a..dff49e83ba6 100644 --- a/arch/powerpc/platforms/85xx/p1010rdb.c +++ b/arch/powerpc/platforms/85xx/p1010rdb.c | |||
@@ -33,7 +33,6 @@ | |||
33 | void __init p1010_rdb_pic_init(void) | 33 | void __init p1010_rdb_pic_init(void) |
34 | { | 34 | { |
35 | struct mpic *mpic; | 35 | struct mpic *mpic; |
36 | struct resource r; | ||
37 | struct device_node *np; | 36 | struct device_node *np; |
38 | 37 | ||
39 | np = of_find_node_by_type(NULL, "open-pic"); | 38 | np = of_find_node_by_type(NULL, "open-pic"); |
@@ -42,13 +41,7 @@ void __init p1010_rdb_pic_init(void) | |||
42 | return; | 41 | return; |
43 | } | 42 | } |
44 | 43 | ||
45 | if (of_address_to_resource(np, 0, &r)) { | 44 | mpic = mpic_alloc(np, 0, MPIC_PRIMARY | MPIC_WANTS_RESET | |
46 | printk(KERN_ERR "Failed to map mpic register space\n"); | ||
47 | of_node_put(np); | ||
48 | return; | ||
49 | } | ||
50 | |||
51 | mpic = mpic_alloc(np, r.start, MPIC_PRIMARY | MPIC_WANTS_RESET | | ||
52 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU, | 45 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU, |
53 | 0, 256, " OpenPIC "); | 46 | 0, 256, " OpenPIC "); |
54 | 47 | ||
diff --git a/arch/powerpc/platforms/85xx/p1022_ds.c b/arch/powerpc/platforms/85xx/p1022_ds.c index 8d5c22bfdd2..6d684c2979a 100644 --- a/arch/powerpc/platforms/85xx/p1022_ds.c +++ b/arch/powerpc/platforms/85xx/p1022_ds.c | |||
@@ -242,7 +242,6 @@ p1022ds_valid_monitor_port(enum fsl_diu_monitor_port port) | |||
242 | void __init p1022_ds_pic_init(void) | 242 | void __init p1022_ds_pic_init(void) |
243 | { | 243 | { |
244 | struct mpic *mpic; | 244 | struct mpic *mpic; |
245 | struct resource r; | ||
246 | struct device_node *np; | 245 | struct device_node *np; |
247 | 246 | ||
248 | np = of_find_node_by_type(NULL, "open-pic"); | 247 | np = of_find_node_by_type(NULL, "open-pic"); |
@@ -251,13 +250,7 @@ void __init p1022_ds_pic_init(void) | |||
251 | return; | 250 | return; |
252 | } | 251 | } |
253 | 252 | ||
254 | if (of_address_to_resource(np, 0, &r)) { | 253 | mpic = mpic_alloc(np, 0, |
255 | pr_err("Failed to map mpic register space\n"); | ||
256 | of_node_put(np); | ||
257 | return; | ||
258 | } | ||
259 | |||
260 | mpic = mpic_alloc(np, r.start, | ||
261 | MPIC_PRIMARY | MPIC_WANTS_RESET | | 254 | MPIC_PRIMARY | MPIC_WANTS_RESET | |
262 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | | 255 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | |
263 | MPIC_SINGLE_DEST_CPU, | 256 | MPIC_SINGLE_DEST_CPU, |
diff --git a/arch/powerpc/platforms/85xx/p1023_rds.c b/arch/powerpc/platforms/85xx/p1023_rds.c index 57c3e0f32e9..df7ccf68821 100644 --- a/arch/powerpc/platforms/85xx/p1023_rds.c +++ b/arch/powerpc/platforms/85xx/p1023_rds.c | |||
@@ -94,7 +94,6 @@ machine_device_initcall(p1023_rds, mpc85xx_common_publish_devices); | |||
94 | static void __init mpc85xx_rds_pic_init(void) | 94 | static void __init mpc85xx_rds_pic_init(void) |
95 | { | 95 | { |
96 | struct mpic *mpic; | 96 | struct mpic *mpic; |
97 | struct resource r; | ||
98 | struct device_node *np = NULL; | 97 | struct device_node *np = NULL; |
99 | 98 | ||
100 | np = of_find_node_by_type(NULL, "open-pic"); | 99 | np = of_find_node_by_type(NULL, "open-pic"); |
@@ -103,13 +102,7 @@ static void __init mpc85xx_rds_pic_init(void) | |||
103 | return; | 102 | return; |
104 | } | 103 | } |
105 | 104 | ||
106 | if (of_address_to_resource(np, 0, &r)) { | 105 | mpic = mpic_alloc(np, 0, |
107 | printk(KERN_ERR "Failed to map mpic register space\n"); | ||
108 | of_node_put(np); | ||
109 | return; | ||
110 | } | ||
111 | |||
112 | mpic = mpic_alloc(np, r.start, | ||
113 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN | | 106 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN | |
114 | MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU, | 107 | MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU, |
115 | 0, 256, " OpenPIC "); | 108 | 0, 256, " OpenPIC "); |
diff --git a/arch/powerpc/platforms/85xx/sbc8548.c b/arch/powerpc/platforms/85xx/sbc8548.c index 845ed3b8946..5e16025a755 100644 --- a/arch/powerpc/platforms/85xx/sbc8548.c +++ b/arch/powerpc/platforms/85xx/sbc8548.c | |||
@@ -55,7 +55,6 @@ static int sbc_rev; | |||
55 | static void __init sbc8548_pic_init(void) | 55 | static void __init sbc8548_pic_init(void) |
56 | { | 56 | { |
57 | struct mpic *mpic; | 57 | struct mpic *mpic; |
58 | struct resource r; | ||
59 | struct device_node *np = NULL; | 58 | struct device_node *np = NULL; |
60 | 59 | ||
61 | np = of_find_node_by_type(np, "open-pic"); | 60 | np = of_find_node_by_type(np, "open-pic"); |
@@ -65,13 +64,7 @@ static void __init sbc8548_pic_init(void) | |||
65 | return; | 64 | return; |
66 | } | 65 | } |
67 | 66 | ||
68 | if (of_address_to_resource(np, 0, &r)) { | 67 | mpic = mpic_alloc(np, 0, |
69 | printk(KERN_ERR "Failed to map mpic register space\n"); | ||
70 | of_node_put(np); | ||
71 | return; | ||
72 | } | ||
73 | |||
74 | mpic = mpic_alloc(np, r.start, | ||
75 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, | 68 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, |
76 | 0, 256, " OpenPIC "); | 69 | 0, 256, " OpenPIC "); |
77 | BUG_ON(mpic == NULL); | 70 | BUG_ON(mpic == NULL); |
diff --git a/arch/powerpc/platforms/85xx/sbc8560.c b/arch/powerpc/platforms/85xx/sbc8560.c index e9a7ed228d7..97f00dec0d9 100644 --- a/arch/powerpc/platforms/85xx/sbc8560.c +++ b/arch/powerpc/platforms/85xx/sbc8560.c | |||
@@ -42,7 +42,6 @@ | |||
42 | static void __init sbc8560_pic_init(void) | 42 | static void __init sbc8560_pic_init(void) |
43 | { | 43 | { |
44 | struct mpic *mpic; | 44 | struct mpic *mpic; |
45 | struct resource r; | ||
46 | struct device_node *np = NULL; | 45 | struct device_node *np = NULL; |
47 | 46 | ||
48 | np = of_find_node_by_type(np, "open-pic"); | 47 | np = of_find_node_by_type(np, "open-pic"); |
@@ -51,13 +50,7 @@ static void __init sbc8560_pic_init(void) | |||
51 | return; | 50 | return; |
52 | } | 51 | } |
53 | 52 | ||
54 | if (of_address_to_resource(np, 0, &r)) { | 53 | mpic = mpic_alloc(np, 0, |
55 | printk(KERN_ERR "Could not map mpic register space\n"); | ||
56 | of_node_put(np); | ||
57 | return; | ||
58 | } | ||
59 | |||
60 | mpic = mpic_alloc(np, r.start, | ||
61 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, | 54 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, |
62 | 0, 256, " OpenPIC "); | 55 | 0, 256, " OpenPIC "); |
63 | BUG_ON(mpic == NULL); | 56 | BUG_ON(mpic == NULL); |
diff --git a/arch/powerpc/platforms/85xx/socrates.c b/arch/powerpc/platforms/85xx/socrates.c index fec496ad79c..e87e75cdb94 100644 --- a/arch/powerpc/platforms/85xx/socrates.c +++ b/arch/powerpc/platforms/85xx/socrates.c | |||
@@ -47,7 +47,6 @@ | |||
47 | static void __init socrates_pic_init(void) | 47 | static void __init socrates_pic_init(void) |
48 | { | 48 | { |
49 | struct mpic *mpic; | 49 | struct mpic *mpic; |
50 | struct resource r; | ||
51 | struct device_node *np; | 50 | struct device_node *np; |
52 | 51 | ||
53 | np = of_find_node_by_type(NULL, "open-pic"); | 52 | np = of_find_node_by_type(NULL, "open-pic"); |
@@ -56,13 +55,7 @@ static void __init socrates_pic_init(void) | |||
56 | return; | 55 | return; |
57 | } | 56 | } |
58 | 57 | ||
59 | if (of_address_to_resource(np, 0, &r)) { | 58 | mpic = mpic_alloc(np, 0, |
60 | printk(KERN_ERR "Could not map mpic register space\n"); | ||
61 | of_node_put(np); | ||
62 | return; | ||
63 | } | ||
64 | |||
65 | mpic = mpic_alloc(np, r.start, | ||
66 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, | 59 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, |
67 | 0, 256, " OpenPIC "); | 60 | 0, 256, " OpenPIC "); |
68 | BUG_ON(mpic == NULL); | 61 | BUG_ON(mpic == NULL); |
diff --git a/arch/powerpc/platforms/85xx/stx_gp3.c b/arch/powerpc/platforms/85xx/stx_gp3.c index b44c936c265..060d5148075 100644 --- a/arch/powerpc/platforms/85xx/stx_gp3.c +++ b/arch/powerpc/platforms/85xx/stx_gp3.c | |||
@@ -49,7 +49,6 @@ | |||
49 | static void __init stx_gp3_pic_init(void) | 49 | static void __init stx_gp3_pic_init(void) |
50 | { | 50 | { |
51 | struct mpic *mpic; | 51 | struct mpic *mpic; |
52 | struct resource r; | ||
53 | struct device_node *np; | 52 | struct device_node *np; |
54 | 53 | ||
55 | np = of_find_node_by_type(NULL, "open-pic"); | 54 | np = of_find_node_by_type(NULL, "open-pic"); |
@@ -58,13 +57,7 @@ static void __init stx_gp3_pic_init(void) | |||
58 | return; | 57 | return; |
59 | } | 58 | } |
60 | 59 | ||
61 | if (of_address_to_resource(np, 0, &r)) { | 60 | mpic = mpic_alloc(np, 0, |
62 | printk(KERN_ERR "Could not map mpic register space\n"); | ||
63 | of_node_put(np); | ||
64 | return; | ||
65 | } | ||
66 | |||
67 | mpic = mpic_alloc(np, r.start, | ||
68 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, | 61 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, |
69 | 0, 256, " OpenPIC "); | 62 | 0, 256, " OpenPIC "); |
70 | BUG_ON(mpic == NULL); | 63 | BUG_ON(mpic == NULL); |
diff --git a/arch/powerpc/platforms/85xx/tqm85xx.c b/arch/powerpc/platforms/85xx/tqm85xx.c index 2418bf8d074..a46b9fc6620 100644 --- a/arch/powerpc/platforms/85xx/tqm85xx.c +++ b/arch/powerpc/platforms/85xx/tqm85xx.c | |||
@@ -47,7 +47,6 @@ | |||
47 | static void __init tqm85xx_pic_init(void) | 47 | static void __init tqm85xx_pic_init(void) |
48 | { | 48 | { |
49 | struct mpic *mpic; | 49 | struct mpic *mpic; |
50 | struct resource r; | ||
51 | struct device_node *np; | 50 | struct device_node *np; |
52 | 51 | ||
53 | np = of_find_node_by_type(NULL, "open-pic"); | 52 | np = of_find_node_by_type(NULL, "open-pic"); |
@@ -56,13 +55,7 @@ static void __init tqm85xx_pic_init(void) | |||
56 | return; | 55 | return; |
57 | } | 56 | } |
58 | 57 | ||
59 | if (of_address_to_resource(np, 0, &r)) { | 58 | mpic = mpic_alloc(np, 0, |
60 | printk(KERN_ERR "Could not map mpic register space\n"); | ||
61 | of_node_put(np); | ||
62 | return; | ||
63 | } | ||
64 | |||
65 | mpic = mpic_alloc(np, r.start, | ||
66 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, | 59 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, |
67 | 0, 256, " OpenPIC "); | 60 | 0, 256, " OpenPIC "); |
68 | BUG_ON(mpic == NULL); | 61 | BUG_ON(mpic == NULL); |
diff --git a/arch/powerpc/platforms/85xx/xes_mpc85xx.c b/arch/powerpc/platforms/85xx/xes_mpc85xx.c index daf9bef63de..2be5e4de188 100644 --- a/arch/powerpc/platforms/85xx/xes_mpc85xx.c +++ b/arch/powerpc/platforms/85xx/xes_mpc85xx.c | |||
@@ -44,7 +44,6 @@ | |||
44 | void __init xes_mpc85xx_pic_init(void) | 44 | void __init xes_mpc85xx_pic_init(void) |
45 | { | 45 | { |
46 | struct mpic *mpic; | 46 | struct mpic *mpic; |
47 | struct resource r; | ||
48 | struct device_node *np; | 47 | struct device_node *np; |
49 | 48 | ||
50 | np = of_find_node_by_type(NULL, "open-pic"); | 49 | np = of_find_node_by_type(NULL, "open-pic"); |
@@ -53,13 +52,7 @@ void __init xes_mpc85xx_pic_init(void) | |||
53 | return; | 52 | return; |
54 | } | 53 | } |
55 | 54 | ||
56 | if (of_address_to_resource(np, 0, &r)) { | 55 | mpic = mpic_alloc(np, 0, |
57 | printk(KERN_ERR "Failed to map mpic register space\n"); | ||
58 | of_node_put(np); | ||
59 | return; | ||
60 | } | ||
61 | |||
62 | mpic = mpic_alloc(np, r.start, | ||
63 | MPIC_PRIMARY | MPIC_WANTS_RESET | | 56 | MPIC_PRIMARY | MPIC_WANTS_RESET | |
64 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS, | 57 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS, |
65 | 0, 256, " OpenPIC "); | 58 | 0, 256, " OpenPIC "); |
diff --git a/arch/powerpc/platforms/86xx/pic.c b/arch/powerpc/platforms/86xx/pic.c index 8ef8960abda..f85c8f0aa96 100644 --- a/arch/powerpc/platforms/86xx/pic.c +++ b/arch/powerpc/platforms/86xx/pic.c | |||
@@ -33,7 +33,6 @@ void __init mpc86xx_init_irq(void) | |||
33 | { | 33 | { |
34 | struct mpic *mpic; | 34 | struct mpic *mpic; |
35 | struct device_node *np; | 35 | struct device_node *np; |
36 | struct resource res; | ||
37 | #ifdef CONFIG_PPC_I8259 | 36 | #ifdef CONFIG_PPC_I8259 |
38 | struct device_node *cascade_node = NULL; | 37 | struct device_node *cascade_node = NULL; |
39 | int cascade_irq; | 38 | int cascade_irq; |
@@ -43,9 +42,8 @@ void __init mpc86xx_init_irq(void) | |||
43 | np = of_find_node_by_type(NULL, "open-pic"); | 42 | np = of_find_node_by_type(NULL, "open-pic"); |
44 | if (np == NULL) | 43 | if (np == NULL) |
45 | return; | 44 | return; |
46 | of_address_to_resource(np, 0, &res); | ||
47 | 45 | ||
48 | mpic = mpic_alloc(np, res.start, | 46 | mpic = mpic_alloc(np, 0, |
49 | MPIC_PRIMARY | MPIC_WANTS_RESET | | 47 | MPIC_PRIMARY | MPIC_WANTS_RESET | |
50 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | | 48 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS | |
51 | MPIC_SINGLE_DEST_CPU, | 49 | MPIC_SINGLE_DEST_CPU, |
diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c index 901bfbddc3d..78456fd4416 100644 --- a/arch/powerpc/platforms/powermac/pic.c +++ b/arch/powerpc/platforms/powermac/pic.c | |||
@@ -498,14 +498,8 @@ static struct mpic * __init pmac_setup_one_mpic(struct device_node *np, | |||
498 | int master) | 498 | int master) |
499 | { | 499 | { |
500 | const char *name = master ? " MPIC 1 " : " MPIC 2 "; | 500 | const char *name = master ? " MPIC 1 " : " MPIC 2 "; |
501 | struct resource r; | ||
502 | struct mpic *mpic; | 501 | struct mpic *mpic; |
503 | unsigned int flags = master ? MPIC_PRIMARY : 0; | 502 | unsigned int flags = master ? MPIC_PRIMARY : 0; |
504 | int rc; | ||
505 | |||
506 | rc = of_address_to_resource(np, 0, &r); | ||
507 | if (rc) | ||
508 | return NULL; | ||
509 | 503 | ||
510 | pmac_call_feature(PMAC_FTR_ENABLE_MPIC, np, 0, 0); | 504 | pmac_call_feature(PMAC_FTR_ENABLE_MPIC, np, 0, 0); |
511 | 505 | ||
@@ -519,7 +513,7 @@ static struct mpic * __init pmac_setup_one_mpic(struct device_node *np, | |||
519 | if (master && (flags & MPIC_BIG_ENDIAN)) | 513 | if (master && (flags & MPIC_BIG_ENDIAN)) |
520 | flags |= MPIC_U3_HT_IRQS; | 514 | flags |= MPIC_U3_HT_IRQS; |
521 | 515 | ||
522 | mpic = mpic_alloc(np, r.start, flags, 0, 0, name); | 516 | mpic = mpic_alloc(np, 0, flags, 0, 0, name); |
523 | if (mpic == NULL) | 517 | if (mpic == NULL) |
524 | return NULL; | 518 | return NULL; |
525 | 519 | ||