aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2010-07-22 18:04:30 -0400
committerGrant Likely <grant.likely@secretlab.ca>2010-07-24 11:58:22 -0400
commitcd4cd7306a403f62ef3ca783b9d1cf2a03e595ed (patch)
tree2eceb6990f5a0097f158c91316ee93fc2db5282d /arch
parenta454dc50590c6d758abba016a303a221f2f1b4b8 (diff)
sparc: remove references to of_device and to_of_device
of_device is just a #define alias to platform_device. This patch replaces all references to it with platform_device. Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch')
-rw-r--r--arch/sparc/include/asm/prom.h2
-rw-r--r--arch/sparc/kernel/apc.c4
-rw-r--r--arch/sparc/kernel/auxio_64.c3
-rw-r--r--arch/sparc/kernel/central.c4
-rw-r--r--arch/sparc/kernel/chmc.c12
-rw-r--r--arch/sparc/kernel/ioport.c2
-rw-r--r--arch/sparc/kernel/of_device_32.c14
-rw-r--r--arch/sparc/kernel/of_device_64.c16
-rw-r--r--arch/sparc/kernel/of_device_common.c14
-rw-r--r--arch/sparc/kernel/pci.c4
-rw-r--r--arch/sparc/kernel/pci_fire.c4
-rw-r--r--arch/sparc/kernel/pci_impl.h2
-rw-r--r--arch/sparc/kernel/pci_psycho.c6
-rw-r--r--arch/sparc/kernel/pci_sabre.c6
-rw-r--r--arch/sparc/kernel/pci_schizo.c10
-rw-r--r--arch/sparc/kernel/pci_sun4v.c4
-rw-r--r--arch/sparc/kernel/pmc.c2
-rw-r--r--arch/sparc/kernel/power.c2
-rw-r--r--arch/sparc/kernel/prom_irqtrans.c2
-rw-r--r--arch/sparc/kernel/psycho_common.c2
-rw-r--r--arch/sparc/kernel/psycho_common.h2
-rw-r--r--arch/sparc/kernel/sbus.c16
-rw-r--r--arch/sparc/kernel/time_32.c2
-rw-r--r--arch/sparc/kernel/time_64.c6
-rw-r--r--arch/sparc/mm/io-unit.c4
-rw-r--r--arch/sparc/mm/iommu.c4
26 files changed, 75 insertions, 74 deletions
diff --git a/arch/sparc/include/asm/prom.h b/arch/sparc/include/asm/prom.h
index d35df5ace18a..c82a7da25f9f 100644
--- a/arch/sparc/include/asm/prom.h
+++ b/arch/sparc/include/asm/prom.h
@@ -57,7 +57,7 @@ extern void of_iounmap(struct resource *res, void __iomem *base, unsigned long s
57 57
58/* These routines are here to provide compatibility with how powerpc 58/* These routines are here to provide compatibility with how powerpc
59 * handles IRQ mapping for OF device nodes. We precompute and permanently 59 * handles IRQ mapping for OF device nodes. We precompute and permanently
60 * register them in the of_device objects, whereas powerpc computes them 60 * register them in the platform_device objects, whereas powerpc computes them
61 * on request. 61 * on request.
62 */ 62 */
63static inline void irq_dispose_mapping(unsigned int virq) 63static inline void irq_dispose_mapping(unsigned int virq)
diff --git a/arch/sparc/kernel/apc.c b/arch/sparc/kernel/apc.c
index c471251cd3f1..2c0046ecc715 100644
--- a/arch/sparc/kernel/apc.c
+++ b/arch/sparc/kernel/apc.c
@@ -68,7 +68,7 @@ static void apc_swift_idle(void)
68#endif 68#endif
69} 69}
70 70
71static inline void apc_free(struct of_device *op) 71static inline void apc_free(struct platform_device *op)
72{ 72{
73 of_iounmap(&op->resource[0], regs, resource_size(&op->resource[0])); 73 of_iounmap(&op->resource[0], regs, resource_size(&op->resource[0]));
74} 74}
@@ -136,7 +136,7 @@ static const struct file_operations apc_fops = {
136 136
137static struct miscdevice apc_miscdev = { APC_MINOR, APC_DEVNAME, &apc_fops }; 137static struct miscdevice apc_miscdev = { APC_MINOR, APC_DEVNAME, &apc_fops };
138 138
139static int __devinit apc_probe(struct of_device *op, 139static int __devinit apc_probe(struct platform_device *op,
140 const struct of_device_id *match) 140 const struct of_device_id *match)
141{ 141{
142 int err; 142 int err;
diff --git a/arch/sparc/kernel/auxio_64.c b/arch/sparc/kernel/auxio_64.c
index 46ba58a8510f..3efd3c5af6a9 100644
--- a/arch/sparc/kernel/auxio_64.c
+++ b/arch/sparc/kernel/auxio_64.c
@@ -102,7 +102,8 @@ static struct of_device_id __initdata auxio_match[] = {
102 102
103MODULE_DEVICE_TABLE(of, auxio_match); 103MODULE_DEVICE_TABLE(of, auxio_match);
104 104
105static int __devinit auxio_probe(struct of_device *dev, const struct of_device_id *match) 105static int __devinit auxio_probe(struct platform_device *dev,
106 const struct of_device_id *match)
106{ 107{
107 struct device_node *dp = dev->dev.of_node; 108 struct device_node *dp = dev->dev.of_node;
108 unsigned long size; 109 unsigned long size;
diff --git a/arch/sparc/kernel/central.c b/arch/sparc/kernel/central.c
index b6080c39ed4b..cfa2624c5332 100644
--- a/arch/sparc/kernel/central.c
+++ b/arch/sparc/kernel/central.c
@@ -59,7 +59,7 @@ static int __devinit clock_board_calc_nslots(struct clock_board *p)
59 } 59 }
60} 60}
61 61
62static int __devinit clock_board_probe(struct of_device *op, 62static int __devinit clock_board_probe(struct platform_device *op,
63 const struct of_device_id *match) 63 const struct of_device_id *match)
64{ 64{
65 struct clock_board *p = kzalloc(sizeof(*p), GFP_KERNEL); 65 struct clock_board *p = kzalloc(sizeof(*p), GFP_KERNEL);
@@ -157,7 +157,7 @@ static struct of_platform_driver clock_board_driver = {
157 }, 157 },
158}; 158};
159 159
160static int __devinit fhc_probe(struct of_device *op, 160static int __devinit fhc_probe(struct platform_device *op,
161 const struct of_device_id *match) 161 const struct of_device_id *match)
162{ 162{
163 struct fhc *p = kzalloc(sizeof(*p), GFP_KERNEL); 163 struct fhc *p = kzalloc(sizeof(*p), GFP_KERNEL);
diff --git a/arch/sparc/kernel/chmc.c b/arch/sparc/kernel/chmc.c
index 04bb7df9f716..08c466ebb32b 100644
--- a/arch/sparc/kernel/chmc.c
+++ b/arch/sparc/kernel/chmc.c
@@ -392,7 +392,7 @@ static void __devinit jbusmc_construct_dimm_groups(struct jbusmc *p,
392 } 392 }
393} 393}
394 394
395static int __devinit jbusmc_probe(struct of_device *op, 395static int __devinit jbusmc_probe(struct platform_device *op,
396 const struct of_device_id *match) 396 const struct of_device_id *match)
397{ 397{
398 const struct linux_prom64_registers *mem_regs; 398 const struct linux_prom64_registers *mem_regs;
@@ -690,7 +690,7 @@ static void chmc_fetch_decode_regs(struct chmc *p)
690 chmc_read_mcreg(p, CHMCTRL_DECODE4)); 690 chmc_read_mcreg(p, CHMCTRL_DECODE4));
691} 691}
692 692
693static int __devinit chmc_probe(struct of_device *op, 693static int __devinit chmc_probe(struct platform_device *op,
694 const struct of_device_id *match) 694 const struct of_device_id *match)
695{ 695{
696 struct device_node *dp = op->dev.of_node; 696 struct device_node *dp = op->dev.of_node;
@@ -765,7 +765,7 @@ out_free:
765 goto out; 765 goto out;
766} 766}
767 767
768static int __devinit us3mc_probe(struct of_device *op, 768static int __devinit us3mc_probe(struct platform_device *op,
769 const struct of_device_id *match) 769 const struct of_device_id *match)
770{ 770{
771 if (mc_type == MC_TYPE_SAFARI) 771 if (mc_type == MC_TYPE_SAFARI)
@@ -775,21 +775,21 @@ static int __devinit us3mc_probe(struct of_device *op,
775 return -ENODEV; 775 return -ENODEV;
776} 776}
777 777
778static void __devexit chmc_destroy(struct of_device *op, struct chmc *p) 778static void __devexit chmc_destroy(struct platform_device *op, struct chmc *p)
779{ 779{
780 list_del(&p->list); 780 list_del(&p->list);
781 of_iounmap(&op->resource[0], p->regs, 0x48); 781 of_iounmap(&op->resource[0], p->regs, 0x48);
782 kfree(p); 782 kfree(p);
783} 783}
784 784
785static void __devexit jbusmc_destroy(struct of_device *op, struct jbusmc *p) 785static void __devexit jbusmc_destroy(struct platform_device *op, struct jbusmc *p)
786{ 786{
787 mc_list_del(&p->list); 787 mc_list_del(&p->list);
788 of_iounmap(&op->resource[0], p->regs, JBUSMC_REGS_SIZE); 788 of_iounmap(&op->resource[0], p->regs, JBUSMC_REGS_SIZE);
789 kfree(p); 789 kfree(p);
790} 790}
791 791
792static int __devexit us3mc_remove(struct of_device *op) 792static int __devexit us3mc_remove(struct platform_device *op)
793{ 793{
794 void *p = dev_get_drvdata(&op->dev); 794 void *p = dev_get_drvdata(&op->dev);
795 795
diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c
index 703e4aa9bc38..41f7e4e0f72a 100644
--- a/arch/sparc/kernel/ioport.c
+++ b/arch/sparc/kernel/ioport.c
@@ -253,7 +253,7 @@ EXPORT_SYMBOL(sbus_set_sbus64);
253static void *sbus_alloc_coherent(struct device *dev, size_t len, 253static void *sbus_alloc_coherent(struct device *dev, size_t len,
254 dma_addr_t *dma_addrp, gfp_t gfp) 254 dma_addr_t *dma_addrp, gfp_t gfp)
255{ 255{
256 struct of_device *op = to_of_device(dev); 256 struct platform_device *op = to_platform_device(dev);
257 unsigned long len_total = (len + PAGE_SIZE-1) & PAGE_MASK; 257 unsigned long len_total = (len + PAGE_SIZE-1) & PAGE_MASK;
258 unsigned long va; 258 unsigned long va;
259 struct resource *res; 259 struct resource *res;
diff --git a/arch/sparc/kernel/of_device_32.c b/arch/sparc/kernel/of_device_32.c
index 75fc9d5cd7e6..2d055a1e9cc2 100644
--- a/arch/sparc/kernel/of_device_32.c
+++ b/arch/sparc/kernel/of_device_32.c
@@ -241,10 +241,10 @@ static int __init use_1to1_mapping(struct device_node *pp)
241 241
242static int of_resource_verbose; 242static int of_resource_verbose;
243 243
244static void __init build_device_resources(struct of_device *op, 244static void __init build_device_resources(struct platform_device *op,
245 struct device *parent) 245 struct device *parent)
246{ 246{
247 struct of_device *p_op; 247 struct platform_device *p_op;
248 struct of_bus *bus; 248 struct of_bus *bus;
249 int na, ns; 249 int na, ns;
250 int index, num_reg; 250 int index, num_reg;
@@ -253,7 +253,7 @@ static void __init build_device_resources(struct of_device *op,
253 if (!parent) 253 if (!parent)
254 return; 254 return;
255 255
256 p_op = to_of_device(parent); 256 p_op = to_platform_device(parent);
257 bus = of_match_bus(p_op->dev.of_node); 257 bus = of_match_bus(p_op->dev.of_node);
258 bus->count_cells(op->dev.of_node, &na, &ns); 258 bus->count_cells(op->dev.of_node, &na, &ns);
259 259
@@ -335,10 +335,10 @@ static void __init build_device_resources(struct of_device *op,
335 } 335 }
336} 336}
337 337
338static struct of_device * __init scan_one_device(struct device_node *dp, 338static struct platform_device * __init scan_one_device(struct device_node *dp,
339 struct device *parent) 339 struct device *parent)
340{ 340{
341 struct of_device *op = kzalloc(sizeof(*op), GFP_KERNEL); 341 struct platform_device *op = kzalloc(sizeof(*op), GFP_KERNEL);
342 const struct linux_prom_irqs *intr; 342 const struct linux_prom_irqs *intr;
343 struct dev_archdata *sd; 343 struct dev_archdata *sd;
344 int len, i; 344 int len, i;
@@ -443,7 +443,7 @@ build_resources:
443static void __init scan_tree(struct device_node *dp, struct device *parent) 443static void __init scan_tree(struct device_node *dp, struct device *parent)
444{ 444{
445 while (dp) { 445 while (dp) {
446 struct of_device *op = scan_one_device(dp, parent); 446 struct platform_device *op = scan_one_device(dp, parent);
447 447
448 if (op) 448 if (op)
449 scan_tree(dp->child, &op->dev); 449 scan_tree(dp->child, &op->dev);
@@ -455,7 +455,7 @@ static void __init scan_tree(struct device_node *dp, struct device *parent)
455static int __init scan_of_devices(void) 455static int __init scan_of_devices(void)
456{ 456{
457 struct device_node *root = of_find_node_by_path("/"); 457 struct device_node *root = of_find_node_by_path("/");
458 struct of_device *parent; 458 struct platform_device *parent;
459 459
460 parent = scan_one_device(root, NULL); 460 parent = scan_one_device(root, NULL);
461 if (!parent) 461 if (!parent)
diff --git a/arch/sparc/kernel/of_device_64.c b/arch/sparc/kernel/of_device_64.c
index 9743d1d9fa03..63cd4e5d47c2 100644
--- a/arch/sparc/kernel/of_device_64.c
+++ b/arch/sparc/kernel/of_device_64.c
@@ -310,10 +310,10 @@ static int __init use_1to1_mapping(struct device_node *pp)
310 310
311static int of_resource_verbose; 311static int of_resource_verbose;
312 312
313static void __init build_device_resources(struct of_device *op, 313static void __init build_device_resources(struct platform_device *op,
314 struct device *parent) 314 struct device *parent)
315{ 315{
316 struct of_device *p_op; 316 struct platform_device *p_op;
317 struct of_bus *bus; 317 struct of_bus *bus;
318 int na, ns; 318 int na, ns;
319 int index, num_reg; 319 int index, num_reg;
@@ -322,7 +322,7 @@ static void __init build_device_resources(struct of_device *op,
322 if (!parent) 322 if (!parent)
323 return; 323 return;
324 324
325 p_op = to_of_device(parent); 325 p_op = to_platform_device(parent);
326 bus = of_match_bus(p_op->dev.of_node); 326 bus = of_match_bus(p_op->dev.of_node);
327 bus->count_cells(op->dev.of_node, &na, &ns); 327 bus->count_cells(op->dev.of_node, &na, &ns);
328 328
@@ -528,7 +528,7 @@ static unsigned int __init pci_irq_swizzle(struct device_node *dp,
528 528
529static int of_irq_verbose; 529static int of_irq_verbose;
530 530
531static unsigned int __init build_one_device_irq(struct of_device *op, 531static unsigned int __init build_one_device_irq(struct platform_device *op,
532 struct device *parent, 532 struct device *parent,
533 unsigned int irq) 533 unsigned int irq)
534{ 534{
@@ -630,10 +630,10 @@ out:
630 return irq; 630 return irq;
631} 631}
632 632
633static struct of_device * __init scan_one_device(struct device_node *dp, 633static struct platform_device * __init scan_one_device(struct device_node *dp,
634 struct device *parent) 634 struct device *parent)
635{ 635{
636 struct of_device *op = kzalloc(sizeof(*op), GFP_KERNEL); 636 struct platform_device *op = kzalloc(sizeof(*op), GFP_KERNEL);
637 const unsigned int *irq; 637 const unsigned int *irq;
638 struct dev_archdata *sd; 638 struct dev_archdata *sd;
639 int len, i; 639 int len, i;
@@ -686,7 +686,7 @@ static struct of_device * __init scan_one_device(struct device_node *dp,
686static void __init scan_tree(struct device_node *dp, struct device *parent) 686static void __init scan_tree(struct device_node *dp, struct device *parent)
687{ 687{
688 while (dp) { 688 while (dp) {
689 struct of_device *op = scan_one_device(dp, parent); 689 struct platform_device *op = scan_one_device(dp, parent);
690 690
691 if (op) 691 if (op)
692 scan_tree(dp->child, &op->dev); 692 scan_tree(dp->child, &op->dev);
@@ -698,7 +698,7 @@ static void __init scan_tree(struct device_node *dp, struct device *parent)
698static int __init scan_of_devices(void) 698static int __init scan_of_devices(void)
699{ 699{
700 struct device_node *root = of_find_node_by_path("/"); 700 struct device_node *root = of_find_node_by_path("/");
701 struct of_device *parent; 701 struct platform_device *parent;
702 702
703 parent = scan_one_device(root, NULL); 703 parent = scan_one_device(root, NULL);
704 if (!parent) 704 if (!parent)
diff --git a/arch/sparc/kernel/of_device_common.c b/arch/sparc/kernel/of_device_common.c
index 2a5c639e4c3f..e80729bba028 100644
--- a/arch/sparc/kernel/of_device_common.c
+++ b/arch/sparc/kernel/of_device_common.c
@@ -13,19 +13,19 @@
13 13
14static int node_match(struct device *dev, void *data) 14static int node_match(struct device *dev, void *data)
15{ 15{
16 struct of_device *op = to_of_device(dev); 16 struct platform_device *op = to_platform_device(dev);
17 struct device_node *dp = data; 17 struct device_node *dp = data;
18 18
19 return (op->dev.of_node == dp); 19 return (op->dev.of_node == dp);
20} 20}
21 21
22struct of_device *of_find_device_by_node(struct device_node *dp) 22struct platform_device *of_find_device_by_node(struct device_node *dp)
23{ 23{
24 struct device *dev = bus_find_device(&platform_bus_type, NULL, 24 struct device *dev = bus_find_device(&platform_bus_type, NULL,
25 dp, node_match); 25 dp, node_match);
26 26
27 if (dev) 27 if (dev)
28 return to_of_device(dev); 28 return to_platform_device(dev);
29 29
30 return NULL; 30 return NULL;
31} 31}
@@ -33,7 +33,7 @@ EXPORT_SYMBOL(of_find_device_by_node);
33 33
34unsigned int irq_of_parse_and_map(struct device_node *node, int index) 34unsigned int irq_of_parse_and_map(struct device_node *node, int index)
35{ 35{
36 struct of_device *op = of_find_device_by_node(node); 36 struct platform_device *op = of_find_device_by_node(node);
37 37
38 if (!op || index >= op->archdata.num_irqs) 38 if (!op || index >= op->archdata.num_irqs)
39 return 0; 39 return 0;
@@ -43,16 +43,16 @@ unsigned int irq_of_parse_and_map(struct device_node *node, int index)
43EXPORT_SYMBOL(irq_of_parse_and_map); 43EXPORT_SYMBOL(irq_of_parse_and_map);
44 44
45/* Take the archdata values for IOMMU, STC, and HOSTDATA found in 45/* Take the archdata values for IOMMU, STC, and HOSTDATA found in
46 * BUS and propagate to all child of_device objects. 46 * BUS and propagate to all child platform_device objects.
47 */ 47 */
48void of_propagate_archdata(struct of_device *bus) 48void of_propagate_archdata(struct platform_device *bus)
49{ 49{
50 struct dev_archdata *bus_sd = &bus->dev.archdata; 50 struct dev_archdata *bus_sd = &bus->dev.archdata;
51 struct device_node *bus_dp = bus->dev.of_node; 51 struct device_node *bus_dp = bus->dev.of_node;
52 struct device_node *dp; 52 struct device_node *dp;
53 53
54 for (dp = bus_dp->child; dp; dp = dp->sibling) { 54 for (dp = bus_dp->child; dp; dp = dp->sibling) {
55 struct of_device *op = of_find_device_by_node(dp); 55 struct platform_device *op = of_find_device_by_node(dp);
56 56
57 op->dev.archdata.iommu = bus_sd->iommu; 57 op->dev.archdata.iommu = bus_sd->iommu;
58 op->dev.archdata.stc = bus_sd->stc; 58 op->dev.archdata.stc = bus_sd->stc;
diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c
index 1523290db0a1..4137579d9adc 100644
--- a/arch/sparc/kernel/pci.c
+++ b/arch/sparc/kernel/pci.c
@@ -198,7 +198,7 @@ static unsigned long pci_parse_of_flags(u32 addr0)
198 * into physical address resources, we only have to figure out the register 198 * into physical address resources, we only have to figure out the register
199 * mapping. 199 * mapping.
200 */ 200 */
201static void pci_parse_of_addrs(struct of_device *op, 201static void pci_parse_of_addrs(struct platform_device *op,
202 struct device_node *node, 202 struct device_node *node,
203 struct pci_dev *dev) 203 struct pci_dev *dev)
204{ 204{
@@ -248,7 +248,7 @@ static struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
248{ 248{
249 struct dev_archdata *sd; 249 struct dev_archdata *sd;
250 struct pci_slot *slot; 250 struct pci_slot *slot;
251 struct of_device *op; 251 struct platform_device *op;
252 struct pci_dev *dev; 252 struct pci_dev *dev;
253 const char *type; 253 const char *type;
254 u32 class; 254 u32 class;
diff --git a/arch/sparc/kernel/pci_fire.c b/arch/sparc/kernel/pci_fire.c
index 885f10b742e2..efb896d68754 100644
--- a/arch/sparc/kernel/pci_fire.c
+++ b/arch/sparc/kernel/pci_fire.c
@@ -410,7 +410,7 @@ static void pci_fire_hw_init(struct pci_pbm_info *pbm)
410} 410}
411 411
412static int __devinit pci_fire_pbm_init(struct pci_pbm_info *pbm, 412static int __devinit pci_fire_pbm_init(struct pci_pbm_info *pbm,
413 struct of_device *op, u32 portid) 413 struct platform_device *op, u32 portid)
414{ 414{
415 const struct linux_prom64_registers *regs; 415 const struct linux_prom64_registers *regs;
416 struct device_node *dp = op->dev.of_node; 416 struct device_node *dp = op->dev.of_node;
@@ -455,7 +455,7 @@ static int __devinit pci_fire_pbm_init(struct pci_pbm_info *pbm,
455 return 0; 455 return 0;
456} 456}
457 457
458static int __devinit fire_probe(struct of_device *op, 458static int __devinit fire_probe(struct platform_device *op,
459 const struct of_device_id *match) 459 const struct of_device_id *match)
460{ 460{
461 struct device_node *dp = op->dev.of_node; 461 struct device_node *dp = op->dev.of_node;
diff --git a/arch/sparc/kernel/pci_impl.h b/arch/sparc/kernel/pci_impl.h
index 03186824327e..e20ed5f06e9c 100644
--- a/arch/sparc/kernel/pci_impl.h
+++ b/arch/sparc/kernel/pci_impl.h
@@ -91,7 +91,7 @@ struct pci_pbm_info {
91 char *name; 91 char *name;
92 92
93 /* OBP specific information. */ 93 /* OBP specific information. */
94 struct of_device *op; 94 struct platform_device *op;
95 u64 ino_bitmap; 95 u64 ino_bitmap;
96 96
97 /* PBM I/O and Memory space resources. */ 97 /* PBM I/O and Memory space resources. */
diff --git a/arch/sparc/kernel/pci_psycho.c b/arch/sparc/kernel/pci_psycho.c
index 71550a7aacd8..22eab7cf3b11 100644
--- a/arch/sparc/kernel/pci_psycho.c
+++ b/arch/sparc/kernel/pci_psycho.c
@@ -285,7 +285,7 @@ static irqreturn_t psycho_ce_intr(int irq, void *dev_id)
285#define PSYCHO_ECCCTRL_CE 0x2000000000000000UL /* Enable CE INterrupts */ 285#define PSYCHO_ECCCTRL_CE 0x2000000000000000UL /* Enable CE INterrupts */
286static void psycho_register_error_handlers(struct pci_pbm_info *pbm) 286static void psycho_register_error_handlers(struct pci_pbm_info *pbm)
287{ 287{
288 struct of_device *op = of_find_device_by_node(pbm->op->dev.of_node); 288 struct platform_device *op = of_find_device_by_node(pbm->op->dev.of_node);
289 unsigned long base = pbm->controller_regs; 289 unsigned long base = pbm->controller_regs;
290 u64 tmp; 290 u64 tmp;
291 int err; 291 int err;
@@ -483,7 +483,7 @@ static void psycho_pbm_strbuf_init(struct pci_pbm_info *pbm,
483#define PSYCHO_MEMSPACE_SIZE 0x07fffffffUL 483#define PSYCHO_MEMSPACE_SIZE 0x07fffffffUL
484 484
485static void __devinit psycho_pbm_init(struct pci_pbm_info *pbm, 485static void __devinit psycho_pbm_init(struct pci_pbm_info *pbm,
486 struct of_device *op, int is_pbm_a) 486 struct platform_device *op, int is_pbm_a)
487{ 487{
488 psycho_pbm_init_common(pbm, op, "PSYCHO", PBM_CHIP_TYPE_PSYCHO); 488 psycho_pbm_init_common(pbm, op, "PSYCHO", PBM_CHIP_TYPE_PSYCHO);
489 psycho_pbm_strbuf_init(pbm, is_pbm_a); 489 psycho_pbm_strbuf_init(pbm, is_pbm_a);
@@ -503,7 +503,7 @@ static struct pci_pbm_info * __devinit psycho_find_sibling(u32 upa_portid)
503 503
504#define PSYCHO_CONFIGSPACE 0x001000000UL 504#define PSYCHO_CONFIGSPACE 0x001000000UL
505 505
506static int __devinit psycho_probe(struct of_device *op, 506static int __devinit psycho_probe(struct platform_device *op,
507 const struct of_device_id *match) 507 const struct of_device_id *match)
508{ 508{
509 const struct linux_prom64_registers *pr_regs; 509 const struct linux_prom64_registers *pr_regs;
diff --git a/arch/sparc/kernel/pci_sabre.c b/arch/sparc/kernel/pci_sabre.c
index 2d7bf30552dd..5c3f5ec4cabc 100644
--- a/arch/sparc/kernel/pci_sabre.c
+++ b/arch/sparc/kernel/pci_sabre.c
@@ -311,7 +311,7 @@ static irqreturn_t sabre_ce_intr(int irq, void *dev_id)
311static void sabre_register_error_handlers(struct pci_pbm_info *pbm) 311static void sabre_register_error_handlers(struct pci_pbm_info *pbm)
312{ 312{
313 struct device_node *dp = pbm->op->dev.of_node; 313 struct device_node *dp = pbm->op->dev.of_node;
314 struct of_device *op; 314 struct platform_device *op;
315 unsigned long base = pbm->controller_regs; 315 unsigned long base = pbm->controller_regs;
316 u64 tmp; 316 u64 tmp;
317 int err; 317 int err;
@@ -443,7 +443,7 @@ static void __devinit sabre_scan_bus(struct pci_pbm_info *pbm,
443} 443}
444 444
445static void __devinit sabre_pbm_init(struct pci_pbm_info *pbm, 445static void __devinit sabre_pbm_init(struct pci_pbm_info *pbm,
446 struct of_device *op) 446 struct platform_device *op)
447{ 447{
448 psycho_pbm_init_common(pbm, op, "SABRE", PBM_CHIP_TYPE_SABRE); 448 psycho_pbm_init_common(pbm, op, "SABRE", PBM_CHIP_TYPE_SABRE);
449 pbm->pci_afsr = pbm->controller_regs + SABRE_PIOAFSR; 449 pbm->pci_afsr = pbm->controller_regs + SABRE_PIOAFSR;
@@ -452,7 +452,7 @@ static void __devinit sabre_pbm_init(struct pci_pbm_info *pbm,
452 sabre_scan_bus(pbm, &op->dev); 452 sabre_scan_bus(pbm, &op->dev);
453} 453}
454 454
455static int __devinit sabre_probe(struct of_device *op, 455static int __devinit sabre_probe(struct platform_device *op,
456 const struct of_device_id *match) 456 const struct of_device_id *match)
457{ 457{
458 const struct linux_prom64_registers *pr_regs; 458 const struct linux_prom64_registers *pr_regs;
diff --git a/arch/sparc/kernel/pci_schizo.c b/arch/sparc/kernel/pci_schizo.c
index 04f29c46bfa0..445a47a2fb3d 100644
--- a/arch/sparc/kernel/pci_schizo.c
+++ b/arch/sparc/kernel/pci_schizo.c
@@ -844,7 +844,7 @@ static int pbm_routes_this_ino(struct pci_pbm_info *pbm, u32 ino)
844 */ 844 */
845static void tomatillo_register_error_handlers(struct pci_pbm_info *pbm) 845static void tomatillo_register_error_handlers(struct pci_pbm_info *pbm)
846{ 846{
847 struct of_device *op = of_find_device_by_node(pbm->op->dev.of_node); 847 struct platform_device *op = of_find_device_by_node(pbm->op->dev.of_node);
848 u64 tmp, err_mask, err_no_mask; 848 u64 tmp, err_mask, err_no_mask;
849 int err; 849 int err;
850 850
@@ -939,7 +939,7 @@ static void tomatillo_register_error_handlers(struct pci_pbm_info *pbm)
939 939
940static void schizo_register_error_handlers(struct pci_pbm_info *pbm) 940static void schizo_register_error_handlers(struct pci_pbm_info *pbm)
941{ 941{
942 struct of_device *op = of_find_device_by_node(pbm->op->dev.of_node); 942 struct platform_device *op = of_find_device_by_node(pbm->op->dev.of_node);
943 u64 tmp, err_mask, err_no_mask; 943 u64 tmp, err_mask, err_no_mask;
944 int err; 944 int err;
945 945
@@ -1307,7 +1307,7 @@ static void schizo_pbm_hw_init(struct pci_pbm_info *pbm)
1307} 1307}
1308 1308
1309static int __devinit schizo_pbm_init(struct pci_pbm_info *pbm, 1309static int __devinit schizo_pbm_init(struct pci_pbm_info *pbm,
1310 struct of_device *op, u32 portid, 1310 struct platform_device *op, u32 portid,
1311 int chip_type) 1311 int chip_type)
1312{ 1312{
1313 const struct linux_prom64_registers *regs; 1313 const struct linux_prom64_registers *regs;
@@ -1413,7 +1413,7 @@ static struct pci_pbm_info * __devinit schizo_find_sibling(u32 portid,
1413 return NULL; 1413 return NULL;
1414} 1414}
1415 1415
1416static int __devinit __schizo_init(struct of_device *op, unsigned long chip_type) 1416static int __devinit __schizo_init(struct platform_device *op, unsigned long chip_type)
1417{ 1417{
1418 struct device_node *dp = op->dev.of_node; 1418 struct device_node *dp = op->dev.of_node;
1419 struct pci_pbm_info *pbm; 1419 struct pci_pbm_info *pbm;
@@ -1460,7 +1460,7 @@ out_err:
1460 return err; 1460 return err;
1461} 1461}
1462 1462
1463static int __devinit schizo_probe(struct of_device *op, 1463static int __devinit schizo_probe(struct platform_device *op,
1464 const struct of_device_id *match) 1464 const struct of_device_id *match)
1465{ 1465{
1466 return __schizo_init(op, (unsigned long) match->data); 1466 return __schizo_init(op, (unsigned long) match->data);
diff --git a/arch/sparc/kernel/pci_sun4v.c b/arch/sparc/kernel/pci_sun4v.c
index 18ee8b6f4036..743344aa6d8a 100644
--- a/arch/sparc/kernel/pci_sun4v.c
+++ b/arch/sparc/kernel/pci_sun4v.c
@@ -879,7 +879,7 @@ static void pci_sun4v_msi_init(struct pci_pbm_info *pbm)
879#endif /* !(CONFIG_PCI_MSI) */ 879#endif /* !(CONFIG_PCI_MSI) */
880 880
881static int __devinit pci_sun4v_pbm_init(struct pci_pbm_info *pbm, 881static int __devinit pci_sun4v_pbm_init(struct pci_pbm_info *pbm,
882 struct of_device *op, u32 devhandle) 882 struct platform_device *op, u32 devhandle)
883{ 883{
884 struct device_node *dp = op->dev.of_node; 884 struct device_node *dp = op->dev.of_node;
885 int err; 885 int err;
@@ -918,7 +918,7 @@ static int __devinit pci_sun4v_pbm_init(struct pci_pbm_info *pbm,
918 return 0; 918 return 0;
919} 919}
920 920
921static int __devinit pci_sun4v_probe(struct of_device *op, 921static int __devinit pci_sun4v_probe(struct platform_device *op,
922 const struct of_device_id *match) 922 const struct of_device_id *match)
923{ 923{
924 const struct linux_prom64_registers *regs; 924 const struct linux_prom64_registers *regs;
diff --git a/arch/sparc/kernel/pmc.c b/arch/sparc/kernel/pmc.c
index a4c73edc8975..94536a85f161 100644
--- a/arch/sparc/kernel/pmc.c
+++ b/arch/sparc/kernel/pmc.c
@@ -51,7 +51,7 @@ static void pmc_swift_idle(void)
51#endif 51#endif
52} 52}
53 53
54static int __devinit pmc_probe(struct of_device *op, 54static int __devinit pmc_probe(struct platform_device *op,
55 const struct of_device_id *match) 55 const struct of_device_id *match)
56{ 56{
57 regs = of_ioremap(&op->resource[0], 0, 57 regs = of_ioremap(&op->resource[0], 0,
diff --git a/arch/sparc/kernel/power.c b/arch/sparc/kernel/power.c
index abc194ed5a78..2c59f4d387dd 100644
--- a/arch/sparc/kernel/power.c
+++ b/arch/sparc/kernel/power.c
@@ -33,7 +33,7 @@ static int __devinit has_button_interrupt(unsigned int irq, struct device_node *
33 return 1; 33 return 1;
34} 34}
35 35
36static int __devinit power_probe(struct of_device *op, const struct of_device_id *match) 36static int __devinit power_probe(struct platform_device *op, const struct of_device_id *match)
37{ 37{
38 struct resource *res = &op->resource[0]; 38 struct resource *res = &op->resource[0];
39 unsigned int irq = op->archdata.irqs[0]; 39 unsigned int irq = op->archdata.irqs[0];
diff --git a/arch/sparc/kernel/prom_irqtrans.c b/arch/sparc/kernel/prom_irqtrans.c
index 5702ad4710cb..ce651147fabc 100644
--- a/arch/sparc/kernel/prom_irqtrans.c
+++ b/arch/sparc/kernel/prom_irqtrans.c
@@ -719,7 +719,7 @@ static unsigned int central_build_irq(struct device_node *dp,
719 void *_data) 719 void *_data)
720{ 720{
721 struct device_node *central_dp = _data; 721 struct device_node *central_dp = _data;
722 struct of_device *central_op = of_find_device_by_node(central_dp); 722 struct platform_device *central_op = of_find_device_by_node(central_dp);
723 struct resource *res; 723 struct resource *res;
724 unsigned long imap, iclr; 724 unsigned long imap, iclr;
725 u32 tmp; 725 u32 tmp;
diff --git a/arch/sparc/kernel/psycho_common.c b/arch/sparc/kernel/psycho_common.c
index 3f34ac853931..fe2af66bb198 100644
--- a/arch/sparc/kernel/psycho_common.c
+++ b/arch/sparc/kernel/psycho_common.c
@@ -447,7 +447,7 @@ int psycho_iommu_init(struct pci_pbm_info *pbm, int tsbsize,
447 447
448} 448}
449 449
450void psycho_pbm_init_common(struct pci_pbm_info *pbm, struct of_device *op, 450void psycho_pbm_init_common(struct pci_pbm_info *pbm, struct platform_device *op,
451 const char *chip_name, int chip_type) 451 const char *chip_name, int chip_type)
452{ 452{
453 struct device_node *dp = op->dev.of_node; 453 struct device_node *dp = op->dev.of_node;
diff --git a/arch/sparc/kernel/psycho_common.h b/arch/sparc/kernel/psycho_common.h
index 092c278ef28d..590b4ed8ab5e 100644
--- a/arch/sparc/kernel/psycho_common.h
+++ b/arch/sparc/kernel/psycho_common.h
@@ -42,7 +42,7 @@ extern int psycho_iommu_init(struct pci_pbm_info *pbm, int tsbsize,
42 unsigned long write_complete_offset); 42 unsigned long write_complete_offset);
43 43
44extern void psycho_pbm_init_common(struct pci_pbm_info *pbm, 44extern void psycho_pbm_init_common(struct pci_pbm_info *pbm,
45 struct of_device *op, 45 struct platform_device *op,
46 const char *chip_name, int chip_type); 46 const char *chip_name, int chip_type);
47 47
48#endif /* _PSYCHO_COMMON_H */ 48#endif /* _PSYCHO_COMMON_H */
diff --git a/arch/sparc/kernel/sbus.c b/arch/sparc/kernel/sbus.c
index cfeaf04b9cdf..2ca32d13abcf 100644
--- a/arch/sparc/kernel/sbus.c
+++ b/arch/sparc/kernel/sbus.c
@@ -57,7 +57,7 @@
57void sbus_set_sbus64(struct device *dev, int bursts) 57void sbus_set_sbus64(struct device *dev, int bursts)
58{ 58{
59 struct iommu *iommu = dev->archdata.iommu; 59 struct iommu *iommu = dev->archdata.iommu;
60 struct of_device *op = to_of_device(dev); 60 struct platform_device *op = to_platform_device(dev);
61 const struct linux_prom_registers *regs; 61 const struct linux_prom_registers *regs;
62 unsigned long cfg_reg; 62 unsigned long cfg_reg;
63 int slot; 63 int slot;
@@ -204,7 +204,7 @@ static unsigned long sysio_imap_to_iclr(unsigned long imap)
204 return imap + diff; 204 return imap + diff;
205} 205}
206 206
207static unsigned int sbus_build_irq(struct of_device *op, unsigned int ino) 207static unsigned int sbus_build_irq(struct platform_device *op, unsigned int ino)
208{ 208{
209 struct iommu *iommu = op->dev.archdata.iommu; 209 struct iommu *iommu = op->dev.archdata.iommu;
210 unsigned long reg_base = iommu->write_complete_reg - 0x2000UL; 210 unsigned long reg_base = iommu->write_complete_reg - 0x2000UL;
@@ -267,7 +267,7 @@ static unsigned int sbus_build_irq(struct of_device *op, unsigned int ino)
267#define SYSIO_UEAFSR_RESV2 0x0000001fffffffffUL /* Reserved */ 267#define SYSIO_UEAFSR_RESV2 0x0000001fffffffffUL /* Reserved */
268static irqreturn_t sysio_ue_handler(int irq, void *dev_id) 268static irqreturn_t sysio_ue_handler(int irq, void *dev_id)
269{ 269{
270 struct of_device *op = dev_id; 270 struct platform_device *op = dev_id;
271 struct iommu *iommu = op->dev.archdata.iommu; 271 struct iommu *iommu = op->dev.archdata.iommu;
272 unsigned long reg_base = iommu->write_complete_reg - 0x2000UL; 272 unsigned long reg_base = iommu->write_complete_reg - 0x2000UL;
273 unsigned long afsr_reg, afar_reg; 273 unsigned long afsr_reg, afar_reg;
@@ -341,7 +341,7 @@ static irqreturn_t sysio_ue_handler(int irq, void *dev_id)
341#define SYSIO_CEAFSR_RESV2 0x0000001fffffffffUL /* Reserved */ 341#define SYSIO_CEAFSR_RESV2 0x0000001fffffffffUL /* Reserved */
342static irqreturn_t sysio_ce_handler(int irq, void *dev_id) 342static irqreturn_t sysio_ce_handler(int irq, void *dev_id)
343{ 343{
344 struct of_device *op = dev_id; 344 struct platform_device *op = dev_id;
345 struct iommu *iommu = op->dev.archdata.iommu; 345 struct iommu *iommu = op->dev.archdata.iommu;
346 unsigned long reg_base = iommu->write_complete_reg - 0x2000UL; 346 unsigned long reg_base = iommu->write_complete_reg - 0x2000UL;
347 unsigned long afsr_reg, afar_reg; 347 unsigned long afsr_reg, afar_reg;
@@ -420,7 +420,7 @@ static irqreturn_t sysio_ce_handler(int irq, void *dev_id)
420#define SYSIO_SBAFSR_RESV3 0x0000001fffffffffUL /* Reserved */ 420#define SYSIO_SBAFSR_RESV3 0x0000001fffffffffUL /* Reserved */
421static irqreturn_t sysio_sbus_error_handler(int irq, void *dev_id) 421static irqreturn_t sysio_sbus_error_handler(int irq, void *dev_id)
422{ 422{
423 struct of_device *op = dev_id; 423 struct platform_device *op = dev_id;
424 struct iommu *iommu = op->dev.archdata.iommu; 424 struct iommu *iommu = op->dev.archdata.iommu;
425 unsigned long afsr_reg, afar_reg, reg_base; 425 unsigned long afsr_reg, afar_reg, reg_base;
426 unsigned long afsr, afar, error_bits; 426 unsigned long afsr, afar, error_bits;
@@ -488,7 +488,7 @@ static irqreturn_t sysio_sbus_error_handler(int irq, void *dev_id)
488#define SYSIO_CE_INO 0x35 488#define SYSIO_CE_INO 0x35
489#define SYSIO_SBUSERR_INO 0x36 489#define SYSIO_SBUSERR_INO 0x36
490 490
491static void __init sysio_register_error_handlers(struct of_device *op) 491static void __init sysio_register_error_handlers(struct platform_device *op)
492{ 492{
493 struct iommu *iommu = op->dev.archdata.iommu; 493 struct iommu *iommu = op->dev.archdata.iommu;
494 unsigned long reg_base = iommu->write_complete_reg - 0x2000UL; 494 unsigned long reg_base = iommu->write_complete_reg - 0x2000UL;
@@ -534,7 +534,7 @@ static void __init sysio_register_error_handlers(struct of_device *op)
534} 534}
535 535
536/* Boot time initialization. */ 536/* Boot time initialization. */
537static void __init sbus_iommu_init(struct of_device *op) 537static void __init sbus_iommu_init(struct platform_device *op)
538{ 538{
539 const struct linux_prom64_registers *pr; 539 const struct linux_prom64_registers *pr;
540 struct device_node *dp = op->dev.of_node; 540 struct device_node *dp = op->dev.of_node;
@@ -663,7 +663,7 @@ static int __init sbus_init(void)
663 struct device_node *dp; 663 struct device_node *dp;
664 664
665 for_each_node_by_name(dp, "sbus") { 665 for_each_node_by_name(dp, "sbus") {
666 struct of_device *op = of_find_device_by_node(dp); 666 struct platform_device *op = of_find_device_by_node(dp);
667 667
668 sbus_iommu_init(op); 668 sbus_iommu_init(op);
669 of_propagate_archdata(op); 669 of_propagate_archdata(op);
diff --git a/arch/sparc/kernel/time_32.c b/arch/sparc/kernel/time_32.c
index 5dc20216952e..9c743b1886ff 100644
--- a/arch/sparc/kernel/time_32.c
+++ b/arch/sparc/kernel/time_32.c
@@ -142,7 +142,7 @@ static struct platform_device m48t59_rtc = {
142 }, 142 },
143}; 143};
144 144
145static int __devinit clock_probe(struct of_device *op, const struct of_device_id *match) 145static int __devinit clock_probe(struct platform_device *op, const struct of_device_id *match)
146{ 146{
147 struct device_node *dp = op->dev.of_node; 147 struct device_node *dp = op->dev.of_node;
148 const char *model = of_get_property(dp, "model", NULL); 148 const char *model = of_get_property(dp, "model", NULL);
diff --git a/arch/sparc/kernel/time_64.c b/arch/sparc/kernel/time_64.c
index 2423b336a717..3bc9c9979b92 100644
--- a/arch/sparc/kernel/time_64.c
+++ b/arch/sparc/kernel/time_64.c
@@ -419,7 +419,7 @@ static struct platform_device rtc_cmos_device = {
419 .num_resources = 1, 419 .num_resources = 1,
420}; 420};
421 421
422static int __devinit rtc_probe(struct of_device *op, const struct of_device_id *match) 422static int __devinit rtc_probe(struct platform_device *op, const struct of_device_id *match)
423{ 423{
424 struct resource *r; 424 struct resource *r;
425 425
@@ -477,7 +477,7 @@ static struct platform_device rtc_bq4802_device = {
477 .num_resources = 1, 477 .num_resources = 1,
478}; 478};
479 479
480static int __devinit bq4802_probe(struct of_device *op, const struct of_device_id *match) 480static int __devinit bq4802_probe(struct platform_device *op, const struct of_device_id *match)
481{ 481{
482 482
483 printk(KERN_INFO "%s: BQ4802 regs at 0x%llx\n", 483 printk(KERN_INFO "%s: BQ4802 regs at 0x%llx\n",
@@ -534,7 +534,7 @@ static struct platform_device m48t59_rtc = {
534 }, 534 },
535}; 535};
536 536
537static int __devinit mostek_probe(struct of_device *op, const struct of_device_id *match) 537static int __devinit mostek_probe(struct platform_device *op, const struct of_device_id *match)
538{ 538{
539 struct device_node *dp = op->dev.of_node; 539 struct device_node *dp = op->dev.of_node;
540 540
diff --git a/arch/sparc/mm/io-unit.c b/arch/sparc/mm/io-unit.c
index 005e758a4db7..fc58c3e917df 100644
--- a/arch/sparc/mm/io-unit.c
+++ b/arch/sparc/mm/io-unit.c
@@ -35,7 +35,7 @@
35#define IOPERM (IOUPTE_CACHE | IOUPTE_WRITE | IOUPTE_VALID) 35#define IOPERM (IOUPTE_CACHE | IOUPTE_WRITE | IOUPTE_VALID)
36#define MKIOPTE(phys) __iopte((((phys)>>4) & IOUPTE_PAGE) | IOPERM) 36#define MKIOPTE(phys) __iopte((((phys)>>4) & IOUPTE_PAGE) | IOPERM)
37 37
38static void __init iounit_iommu_init(struct of_device *op) 38static void __init iounit_iommu_init(struct platform_device *op)
39{ 39{
40 struct iounit_struct *iounit; 40 struct iounit_struct *iounit;
41 iopte_t *xpt, *xptend; 41 iopte_t *xpt, *xptend;
@@ -74,7 +74,7 @@ static int __init iounit_init(void)
74 struct device_node *dp; 74 struct device_node *dp;
75 75
76 for_each_node_by_name(dp, "sbi") { 76 for_each_node_by_name(dp, "sbi") {
77 struct of_device *op = of_find_device_by_node(dp); 77 struct platform_device *op = of_find_device_by_node(dp);
78 78
79 iounit_iommu_init(op); 79 iounit_iommu_init(op);
80 of_propagate_archdata(op); 80 of_propagate_archdata(op);
diff --git a/arch/sparc/mm/iommu.c b/arch/sparc/mm/iommu.c
index b2e6e73888b5..738580665a8d 100644
--- a/arch/sparc/mm/iommu.c
+++ b/arch/sparc/mm/iommu.c
@@ -56,7 +56,7 @@ static pgprot_t dvma_prot; /* Consistent mapping pte flags */
56#define IOPERM (IOPTE_CACHE | IOPTE_WRITE | IOPTE_VALID) 56#define IOPERM (IOPTE_CACHE | IOPTE_WRITE | IOPTE_VALID)
57#define MKIOPTE(pfn, perm) (((((pfn)<<8) & IOPTE_PAGE) | (perm)) & ~IOPTE_WAZ) 57#define MKIOPTE(pfn, perm) (((((pfn)<<8) & IOPTE_PAGE) | (perm)) & ~IOPTE_WAZ)
58 58
59static void __init sbus_iommu_init(struct of_device *op) 59static void __init sbus_iommu_init(struct platform_device *op)
60{ 60{
61 struct iommu_struct *iommu; 61 struct iommu_struct *iommu;
62 unsigned int impl, vers; 62 unsigned int impl, vers;
@@ -132,7 +132,7 @@ static int __init iommu_init(void)
132 struct device_node *dp; 132 struct device_node *dp;
133 133
134 for_each_node_by_name(dp, "iommu") { 134 for_each_node_by_name(dp, "iommu") {
135 struct of_device *op = of_find_device_by_node(dp); 135 struct platform_device *op = of_find_device_by_node(dp);
136 136
137 sbus_iommu_init(op); 137 sbus_iommu_init(op);
138 of_propagate_archdata(op); 138 of_propagate_archdata(op);