diff options
author | Jiri Kosina <jkosina@suse.cz> | 2010-06-16 12:08:13 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2010-06-16 12:08:13 -0400 |
commit | f1bbbb6912662b9f6070c5bfc4ca9eb1f06a9d5b (patch) | |
tree | c2c130a74be25b0b2dff992e1a195e2728bdaadd /arch/sparc | |
parent | fd0961ff67727482bb20ca7e8ea97b83e9de2ddb (diff) | |
parent | 7e27d6e778cd87b6f2415515d7127eba53fe5d02 (diff) |
Merge branch 'master' into for-next
Diffstat (limited to 'arch/sparc')
32 files changed, 235 insertions, 201 deletions
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index d6781ce687e2..6f1470baa314 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig | |||
@@ -133,6 +133,9 @@ config ZONE_DMA | |||
133 | config NEED_DMA_MAP_STATE | 133 | config NEED_DMA_MAP_STATE |
134 | def_bool y | 134 | def_bool y |
135 | 135 | ||
136 | config NEED_SG_DMA_LENGTH | ||
137 | def_bool y | ||
138 | |||
136 | config GENERIC_ISA_DMA | 139 | config GENERIC_ISA_DMA |
137 | bool | 140 | bool |
138 | default y if SPARC32 | 141 | default y if SPARC32 |
diff --git a/arch/sparc/boot/btfixupprep.c b/arch/sparc/boot/btfixupprep.c index b60491102237..da031159e2b7 100644 --- a/arch/sparc/boot/btfixupprep.c +++ b/arch/sparc/boot/btfixupprep.c | |||
@@ -325,7 +325,7 @@ main1: | |||
325 | (*rr)->next = NULL; | 325 | (*rr)->next = NULL; |
326 | } | 326 | } |
327 | printf("! Generated by btfixupprep. Do not edit.\n\n"); | 327 | printf("! Generated by btfixupprep. Do not edit.\n\n"); |
328 | printf("\t.section\t\".data.init\",#alloc,#write\n\t.align\t4\n\n"); | 328 | printf("\t.section\t\".data..init\",#alloc,#write\n\t.align\t4\n\n"); |
329 | printf("\t.global\t___btfixup_start\n___btfixup_start:\n\n"); | 329 | printf("\t.global\t___btfixup_start\n___btfixup_start:\n\n"); |
330 | for (i = 0; i < last; i++) { | 330 | for (i = 0; i < last; i++) { |
331 | f = array + i; | 331 | f = array + i; |
diff --git a/arch/sparc/include/asm/cache.h b/arch/sparc/include/asm/cache.h index 78b07009f60a..0588b8c7faa2 100644 --- a/arch/sparc/include/asm/cache.h +++ b/arch/sparc/include/asm/cache.h | |||
@@ -21,7 +21,7 @@ | |||
21 | 21 | ||
22 | #define SMP_CACHE_BYTES (1 << SMP_CACHE_BYTES_SHIFT) | 22 | #define SMP_CACHE_BYTES (1 << SMP_CACHE_BYTES_SHIFT) |
23 | 23 | ||
24 | #define __read_mostly __attribute__((__section__(".data.read_mostly"))) | 24 | #define __read_mostly __attribute__((__section__(".data..read_mostly"))) |
25 | 25 | ||
26 | #ifdef CONFIG_SPARC32 | 26 | #ifdef CONFIG_SPARC32 |
27 | #include <asm/asi.h> | 27 | #include <asm/asi.h> |
diff --git a/arch/sparc/include/asm/device.h b/arch/sparc/include/asm/device.h index f3b85b6b0b76..d4c452147412 100644 --- a/arch/sparc/include/asm/device.h +++ b/arch/sparc/include/asm/device.h | |||
@@ -13,25 +13,10 @@ struct dev_archdata { | |||
13 | void *iommu; | 13 | void *iommu; |
14 | void *stc; | 14 | void *stc; |
15 | void *host_controller; | 15 | void *host_controller; |
16 | |||
17 | struct device_node *prom_node; | ||
18 | struct of_device *op; | 16 | struct of_device *op; |
19 | |||
20 | int numa_node; | 17 | int numa_node; |
21 | }; | 18 | }; |
22 | 19 | ||
23 | static inline void dev_archdata_set_node(struct dev_archdata *ad, | ||
24 | struct device_node *np) | ||
25 | { | ||
26 | ad->prom_node = np; | ||
27 | } | ||
28 | |||
29 | static inline struct device_node * | ||
30 | dev_archdata_get_node(const struct dev_archdata *ad) | ||
31 | { | ||
32 | return ad->prom_node; | ||
33 | } | ||
34 | |||
35 | struct pdev_archdata { | 20 | struct pdev_archdata { |
36 | }; | 21 | }; |
37 | 22 | ||
diff --git a/arch/sparc/include/asm/fb.h b/arch/sparc/include/asm/fb.h index b83e44729655..e834880be204 100644 --- a/arch/sparc/include/asm/fb.h +++ b/arch/sparc/include/asm/fb.h | |||
@@ -18,7 +18,7 @@ static inline int fb_is_primary_device(struct fb_info *info) | |||
18 | struct device *dev = info->device; | 18 | struct device *dev = info->device; |
19 | struct device_node *node; | 19 | struct device_node *node; |
20 | 20 | ||
21 | node = dev->archdata.prom_node; | 21 | node = dev->of_node; |
22 | if (node && | 22 | if (node && |
23 | node == of_console_device) | 23 | node == of_console_device) |
24 | return 1; | 24 | return 1; |
diff --git a/arch/sparc/include/asm/floppy_64.h b/arch/sparc/include/asm/floppy_64.h index 36439d67ad71..8fac3ab22f36 100644 --- a/arch/sparc/include/asm/floppy_64.h +++ b/arch/sparc/include/asm/floppy_64.h | |||
@@ -589,7 +589,7 @@ static unsigned long __init sun_floppy_init(void) | |||
589 | if (!op) | 589 | if (!op) |
590 | return 0; | 590 | return 0; |
591 | 591 | ||
592 | state_prop = of_get_property(op->node, "status", NULL); | 592 | state_prop = of_get_property(op->dev.of_node, "status", NULL); |
593 | if (state_prop && !strncmp(state_prop, "disabled", 8)) | 593 | if (state_prop && !strncmp(state_prop, "disabled", 8)) |
594 | return 0; | 594 | return 0; |
595 | 595 | ||
@@ -716,7 +716,7 @@ static unsigned long __init sun_floppy_init(void) | |||
716 | 716 | ||
717 | return sun_floppy_types[0]; | 717 | return sun_floppy_types[0]; |
718 | } | 718 | } |
719 | prop = of_get_property(op->node, "status", NULL); | 719 | prop = of_get_property(op->dev.of_node, "status", NULL); |
720 | if (prop && !strncmp(state, "disabled", 8)) | 720 | if (prop && !strncmp(state, "disabled", 8)) |
721 | return 0; | 721 | return 0; |
722 | 722 | ||
diff --git a/arch/sparc/include/asm/of_device.h b/arch/sparc/include/asm/of_device.h index a5d9811f9697..f320246a0586 100644 --- a/arch/sparc/include/asm/of_device.h +++ b/arch/sparc/include/asm/of_device.h | |||
@@ -14,7 +14,6 @@ | |||
14 | */ | 14 | */ |
15 | struct of_device | 15 | struct of_device |
16 | { | 16 | { |
17 | struct device_node *node; | ||
18 | struct device dev; | 17 | struct device dev; |
19 | struct resource resource[PROMREG_MAX]; | 18 | struct resource resource[PROMREG_MAX]; |
20 | unsigned int irqs[PROMINTR_MAX]; | 19 | unsigned int irqs[PROMINTR_MAX]; |
diff --git a/arch/sparc/include/asm/parport.h b/arch/sparc/include/asm/parport.h index ff9ead640c4a..c333b8d0949b 100644 --- a/arch/sparc/include/asm/parport.h +++ b/arch/sparc/include/asm/parport.h | |||
@@ -113,7 +113,7 @@ static int __devinit ecpp_probe(struct of_device *op, const struct of_device_id | |||
113 | struct parport *p; | 113 | struct parport *p; |
114 | int slot, err; | 114 | int slot, err; |
115 | 115 | ||
116 | parent = op->node->parent; | 116 | parent = op->dev.of_node->parent; |
117 | if (!strcmp(parent->name, "dma")) { | 117 | if (!strcmp(parent->name, "dma")) { |
118 | p = parport_pc_probe_port(base, base + 0x400, | 118 | p = parport_pc_probe_port(base, base + 0x400, |
119 | op->irqs[0], PARPORT_DMA_NOFIFO, | 119 | op->irqs[0], PARPORT_DMA_NOFIFO, |
@@ -232,8 +232,11 @@ static const struct of_device_id ecpp_match[] = { | |||
232 | }; | 232 | }; |
233 | 233 | ||
234 | static struct of_platform_driver ecpp_driver = { | 234 | static struct of_platform_driver ecpp_driver = { |
235 | .name = "ecpp", | 235 | .driver = { |
236 | .match_table = ecpp_match, | 236 | .name = "ecpp", |
237 | .owner = THIS_MODULE, | ||
238 | .of_match_table = ecpp_match, | ||
239 | }, | ||
237 | .probe = ecpp_probe, | 240 | .probe = ecpp_probe, |
238 | .remove = __devexit_p(ecpp_remove), | 241 | .remove = __devexit_p(ecpp_remove), |
239 | }; | 242 | }; |
diff --git a/arch/sparc/include/asm/scatterlist.h b/arch/sparc/include/asm/scatterlist.h index d1120257b033..433e45f05fd4 100644 --- a/arch/sparc/include/asm/scatterlist.h +++ b/arch/sparc/include/asm/scatterlist.h | |||
@@ -1,8 +1,9 @@ | |||
1 | #ifndef _SPARC_SCATTERLIST_H | 1 | #ifndef _SPARC_SCATTERLIST_H |
2 | #define _SPARC_SCATTERLIST_H | 2 | #define _SPARC_SCATTERLIST_H |
3 | 3 | ||
4 | #define sg_dma_len(sg) ((sg)->dma_length) | ||
5 | |||
6 | #include <asm-generic/scatterlist.h> | 4 | #include <asm-generic/scatterlist.h> |
7 | 5 | ||
6 | #define ISA_DMA_THRESHOLD (~0UL) | ||
7 | #define ARCH_HAS_SG_CHAIN | ||
8 | |||
8 | #endif /* !(_SPARC_SCATTERLIST_H) */ | 9 | #endif /* !(_SPARC_SCATTERLIST_H) */ |
diff --git a/arch/sparc/kernel/apc.c b/arch/sparc/kernel/apc.c index 71ec90b9e316..b27476caa133 100644 --- a/arch/sparc/kernel/apc.c +++ b/arch/sparc/kernel/apc.c | |||
@@ -174,8 +174,11 @@ static struct of_device_id __initdata apc_match[] = { | |||
174 | MODULE_DEVICE_TABLE(of, apc_match); | 174 | MODULE_DEVICE_TABLE(of, apc_match); |
175 | 175 | ||
176 | static struct of_platform_driver apc_driver = { | 176 | static struct of_platform_driver apc_driver = { |
177 | .name = "apc", | 177 | .driver = { |
178 | .match_table = apc_match, | 178 | .name = "apc", |
179 | .owner = THIS_MODULE, | ||
180 | .of_match_table = apc_match, | ||
181 | }, | ||
179 | .probe = apc_probe, | 182 | .probe = apc_probe, |
180 | }; | 183 | }; |
181 | 184 | ||
diff --git a/arch/sparc/kernel/auxio_64.c b/arch/sparc/kernel/auxio_64.c index 9f52db2d441c..ddc84128b3c2 100644 --- a/arch/sparc/kernel/auxio_64.c +++ b/arch/sparc/kernel/auxio_64.c | |||
@@ -104,7 +104,7 @@ MODULE_DEVICE_TABLE(of, auxio_match); | |||
104 | 104 | ||
105 | static int __devinit auxio_probe(struct of_device *dev, const struct of_device_id *match) | 105 | static int __devinit auxio_probe(struct of_device *dev, const struct of_device_id *match) |
106 | { | 106 | { |
107 | struct device_node *dp = dev->node; | 107 | struct device_node *dp = dev->dev.of_node; |
108 | unsigned long size; | 108 | unsigned long size; |
109 | 109 | ||
110 | if (!strcmp(dp->parent->name, "ebus")) { | 110 | if (!strcmp(dp->parent->name, "ebus")) { |
@@ -132,10 +132,11 @@ static int __devinit auxio_probe(struct of_device *dev, const struct of_device_i | |||
132 | } | 132 | } |
133 | 133 | ||
134 | static struct of_platform_driver auxio_driver = { | 134 | static struct of_platform_driver auxio_driver = { |
135 | .match_table = auxio_match, | ||
136 | .probe = auxio_probe, | 135 | .probe = auxio_probe, |
137 | .driver = { | 136 | .driver = { |
138 | .name = "auxio", | 137 | .name = "auxio", |
138 | .owner = THIS_MODULE, | ||
139 | .of_match_table = auxio_match, | ||
139 | }, | 140 | }, |
140 | }; | 141 | }; |
141 | 142 | ||
diff --git a/arch/sparc/kernel/central.c b/arch/sparc/kernel/central.c index 415c86d5a8da..434335f65823 100644 --- a/arch/sparc/kernel/central.c +++ b/arch/sparc/kernel/central.c | |||
@@ -149,10 +149,11 @@ static struct of_device_id __initdata clock_board_match[] = { | |||
149 | }; | 149 | }; |
150 | 150 | ||
151 | static struct of_platform_driver clock_board_driver = { | 151 | static struct of_platform_driver clock_board_driver = { |
152 | .match_table = clock_board_match, | ||
153 | .probe = clock_board_probe, | 152 | .probe = clock_board_probe, |
154 | .driver = { | 153 | .driver = { |
155 | .name = "clock_board", | 154 | .name = "clock_board", |
155 | .owner = THIS_MODULE, | ||
156 | .of_match_table = clock_board_match, | ||
156 | }, | 157 | }, |
157 | }; | 158 | }; |
158 | 159 | ||
@@ -168,7 +169,7 @@ static int __devinit fhc_probe(struct of_device *op, | |||
168 | goto out; | 169 | goto out; |
169 | } | 170 | } |
170 | 171 | ||
171 | if (!strcmp(op->node->parent->name, "central")) | 172 | if (!strcmp(op->dev.of_node->parent->name, "central")) |
172 | p->central = true; | 173 | p->central = true; |
173 | 174 | ||
174 | p->pregs = of_ioremap(&op->resource[0], 0, | 175 | p->pregs = of_ioremap(&op->resource[0], 0, |
@@ -183,7 +184,7 @@ static int __devinit fhc_probe(struct of_device *op, | |||
183 | reg = upa_readl(p->pregs + FHC_PREGS_BSR); | 184 | reg = upa_readl(p->pregs + FHC_PREGS_BSR); |
184 | p->board_num = ((reg >> 16) & 1) | ((reg >> 12) & 0x0e); | 185 | p->board_num = ((reg >> 16) & 1) | ((reg >> 12) & 0x0e); |
185 | } else { | 186 | } else { |
186 | p->board_num = of_getintprop_default(op->node, "board#", -1); | 187 | p->board_num = of_getintprop_default(op->dev.of_node, "board#", -1); |
187 | if (p->board_num == -1) { | 188 | if (p->board_num == -1) { |
188 | printk(KERN_ERR "fhc: No board# property\n"); | 189 | printk(KERN_ERR "fhc: No board# property\n"); |
189 | goto out_unmap_pregs; | 190 | goto out_unmap_pregs; |
@@ -254,10 +255,11 @@ static struct of_device_id __initdata fhc_match[] = { | |||
254 | }; | 255 | }; |
255 | 256 | ||
256 | static struct of_platform_driver fhc_driver = { | 257 | static struct of_platform_driver fhc_driver = { |
257 | .match_table = fhc_match, | ||
258 | .probe = fhc_probe, | 258 | .probe = fhc_probe, |
259 | .driver = { | 259 | .driver = { |
260 | .name = "fhc", | 260 | .name = "fhc", |
261 | .owner = THIS_MODULE, | ||
262 | .of_match_table = fhc_match, | ||
261 | }, | 263 | }, |
262 | }; | 264 | }; |
263 | 265 | ||
diff --git a/arch/sparc/kernel/chmc.c b/arch/sparc/kernel/chmc.c index e1a9598e2a4d..870cb65b3f21 100644 --- a/arch/sparc/kernel/chmc.c +++ b/arch/sparc/kernel/chmc.c | |||
@@ -425,7 +425,7 @@ static int __devinit jbusmc_probe(struct of_device *op, | |||
425 | INIT_LIST_HEAD(&p->list); | 425 | INIT_LIST_HEAD(&p->list); |
426 | 426 | ||
427 | err = -ENODEV; | 427 | err = -ENODEV; |
428 | prop = of_get_property(op->node, "portid", &len); | 428 | prop = of_get_property(op->dev.of_node, "portid", &len); |
429 | if (!prop || len != 4) { | 429 | if (!prop || len != 4) { |
430 | printk(KERN_ERR PFX "Cannot find portid.\n"); | 430 | printk(KERN_ERR PFX "Cannot find portid.\n"); |
431 | goto out_free; | 431 | goto out_free; |
@@ -433,7 +433,7 @@ static int __devinit jbusmc_probe(struct of_device *op, | |||
433 | 433 | ||
434 | p->portid = *prop; | 434 | p->portid = *prop; |
435 | 435 | ||
436 | prop = of_get_property(op->node, "memory-control-register-1", &len); | 436 | prop = of_get_property(op->dev.of_node, "memory-control-register-1", &len); |
437 | if (!prop || len != 8) { | 437 | if (!prop || len != 8) { |
438 | printk(KERN_ERR PFX "Cannot get memory control register 1.\n"); | 438 | printk(KERN_ERR PFX "Cannot get memory control register 1.\n"); |
439 | goto out_free; | 439 | goto out_free; |
@@ -449,7 +449,7 @@ static int __devinit jbusmc_probe(struct of_device *op, | |||
449 | } | 449 | } |
450 | 450 | ||
451 | err = -ENODEV; | 451 | err = -ENODEV; |
452 | ml = of_get_property(op->node, "memory-layout", &p->layout_len); | 452 | ml = of_get_property(op->dev.of_node, "memory-layout", &p->layout_len); |
453 | if (!ml) { | 453 | if (!ml) { |
454 | printk(KERN_ERR PFX "Cannot get memory layout property.\n"); | 454 | printk(KERN_ERR PFX "Cannot get memory layout property.\n"); |
455 | goto out_iounmap; | 455 | goto out_iounmap; |
@@ -466,7 +466,7 @@ static int __devinit jbusmc_probe(struct of_device *op, | |||
466 | mc_list_add(&p->list); | 466 | mc_list_add(&p->list); |
467 | 467 | ||
468 | printk(KERN_INFO PFX "UltraSPARC-IIIi memory controller at %s\n", | 468 | printk(KERN_INFO PFX "UltraSPARC-IIIi memory controller at %s\n", |
469 | op->node->full_name); | 469 | op->dev.of_node->full_name); |
470 | 470 | ||
471 | dev_set_drvdata(&op->dev, p); | 471 | dev_set_drvdata(&op->dev, p); |
472 | 472 | ||
@@ -693,7 +693,7 @@ static void chmc_fetch_decode_regs(struct chmc *p) | |||
693 | static int __devinit chmc_probe(struct of_device *op, | 693 | static int __devinit chmc_probe(struct of_device *op, |
694 | const struct of_device_id *match) | 694 | const struct of_device_id *match) |
695 | { | 695 | { |
696 | struct device_node *dp = op->node; | 696 | struct device_node *dp = op->dev.of_node; |
697 | unsigned long ver; | 697 | unsigned long ver; |
698 | const void *pval; | 698 | const void *pval; |
699 | int len, portid; | 699 | int len, portid; |
@@ -811,8 +811,11 @@ static const struct of_device_id us3mc_match[] = { | |||
811 | MODULE_DEVICE_TABLE(of, us3mc_match); | 811 | MODULE_DEVICE_TABLE(of, us3mc_match); |
812 | 812 | ||
813 | static struct of_platform_driver us3mc_driver = { | 813 | static struct of_platform_driver us3mc_driver = { |
814 | .name = "us3mc", | 814 | .driver = { |
815 | .match_table = us3mc_match, | 815 | .name = "us3mc", |
816 | .owner = THIS_MODULE, | ||
817 | .of_match_table = us3mc_match, | ||
818 | }, | ||
816 | .probe = us3mc_probe, | 819 | .probe = us3mc_probe, |
817 | .remove = __devexit_p(us3mc_remove), | 820 | .remove = __devexit_p(us3mc_remove), |
818 | }; | 821 | }; |
diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c index 84e5386714cd..703e4aa9bc38 100644 --- a/arch/sparc/kernel/ioport.c +++ b/arch/sparc/kernel/ioport.c | |||
@@ -290,7 +290,7 @@ static void *sbus_alloc_coherent(struct device *dev, size_t len, | |||
290 | if (mmu_map_dma_area(dev, dma_addrp, va, res->start, len_total) != 0) | 290 | if (mmu_map_dma_area(dev, dma_addrp, va, res->start, len_total) != 0) |
291 | goto err_noiommu; | 291 | goto err_noiommu; |
292 | 292 | ||
293 | res->name = op->node->name; | 293 | res->name = op->dev.of_node->name; |
294 | 294 | ||
295 | return (void *)(unsigned long)res->start; | 295 | return (void *)(unsigned long)res->start; |
296 | 296 | ||
diff --git a/arch/sparc/kernel/of_device_32.c b/arch/sparc/kernel/of_device_32.c index da527b33ebc7..47e63f1e719c 100644 --- a/arch/sparc/kernel/of_device_32.c +++ b/arch/sparc/kernel/of_device_32.c | |||
@@ -254,10 +254,10 @@ static void __init build_device_resources(struct of_device *op, | |||
254 | return; | 254 | return; |
255 | 255 | ||
256 | p_op = to_of_device(parent); | 256 | p_op = to_of_device(parent); |
257 | bus = of_match_bus(p_op->node); | 257 | bus = of_match_bus(p_op->dev.of_node); |
258 | bus->count_cells(op->node, &na, &ns); | 258 | bus->count_cells(op->dev.of_node, &na, &ns); |
259 | 259 | ||
260 | preg = of_get_property(op->node, bus->addr_prop_name, &num_reg); | 260 | preg = of_get_property(op->dev.of_node, bus->addr_prop_name, &num_reg); |
261 | if (!preg || num_reg == 0) | 261 | if (!preg || num_reg == 0) |
262 | return; | 262 | return; |
263 | 263 | ||
@@ -271,8 +271,8 @@ static void __init build_device_resources(struct of_device *op, | |||
271 | struct resource *r = &op->resource[index]; | 271 | struct resource *r = &op->resource[index]; |
272 | u32 addr[OF_MAX_ADDR_CELLS]; | 272 | u32 addr[OF_MAX_ADDR_CELLS]; |
273 | const u32 *reg = (preg + (index * ((na + ns) * 4))); | 273 | const u32 *reg = (preg + (index * ((na + ns) * 4))); |
274 | struct device_node *dp = op->node; | 274 | struct device_node *dp = op->dev.of_node; |
275 | struct device_node *pp = p_op->node; | 275 | struct device_node *pp = p_op->dev.of_node; |
276 | struct of_bus *pbus, *dbus; | 276 | struct of_bus *pbus, *dbus; |
277 | u64 size, result = OF_BAD_ADDR; | 277 | u64 size, result = OF_BAD_ADDR; |
278 | unsigned long flags; | 278 | unsigned long flags; |
@@ -321,7 +321,7 @@ static void __init build_device_resources(struct of_device *op, | |||
321 | 321 | ||
322 | if (of_resource_verbose) | 322 | if (of_resource_verbose) |
323 | printk("%s reg[%d] -> %llx\n", | 323 | printk("%s reg[%d] -> %llx\n", |
324 | op->node->full_name, index, | 324 | op->dev.of_node->full_name, index, |
325 | result); | 325 | result); |
326 | 326 | ||
327 | if (result != OF_BAD_ADDR) { | 327 | if (result != OF_BAD_ADDR) { |
@@ -329,7 +329,7 @@ static void __init build_device_resources(struct of_device *op, | |||
329 | r->end = result + size - 1; | 329 | r->end = result + size - 1; |
330 | r->flags = flags | ((result >> 32ULL) & 0xffUL); | 330 | r->flags = flags | ((result >> 32ULL) & 0xffUL); |
331 | } | 331 | } |
332 | r->name = op->node->name; | 332 | r->name = op->dev.of_node->name; |
333 | } | 333 | } |
334 | } | 334 | } |
335 | 335 | ||
@@ -345,10 +345,9 @@ static struct of_device * __init scan_one_device(struct device_node *dp, | |||
345 | return NULL; | 345 | return NULL; |
346 | 346 | ||
347 | sd = &op->dev.archdata; | 347 | sd = &op->dev.archdata; |
348 | sd->prom_node = dp; | ||
349 | sd->op = op; | 348 | sd->op = op; |
350 | 349 | ||
351 | op->node = dp; | 350 | op->dev.of_node = dp; |
352 | 351 | ||
353 | op->clock_freq = of_getintprop_default(dp, "clock-frequency", | 352 | op->clock_freq = of_getintprop_default(dp, "clock-frequency", |
354 | (25*1000*1000)); | 353 | (25*1000*1000)); |
diff --git a/arch/sparc/kernel/of_device_64.c b/arch/sparc/kernel/of_device_64.c index b3d4cb5d21b3..1dae8079f728 100644 --- a/arch/sparc/kernel/of_device_64.c +++ b/arch/sparc/kernel/of_device_64.c | |||
@@ -323,10 +323,10 @@ static void __init build_device_resources(struct of_device *op, | |||
323 | return; | 323 | return; |
324 | 324 | ||
325 | p_op = to_of_device(parent); | 325 | p_op = to_of_device(parent); |
326 | bus = of_match_bus(p_op->node); | 326 | bus = of_match_bus(p_op->dev.of_node); |
327 | bus->count_cells(op->node, &na, &ns); | 327 | bus->count_cells(op->dev.of_node, &na, &ns); |
328 | 328 | ||
329 | preg = of_get_property(op->node, bus->addr_prop_name, &num_reg); | 329 | preg = of_get_property(op->dev.of_node, bus->addr_prop_name, &num_reg); |
330 | if (!preg || num_reg == 0) | 330 | if (!preg || num_reg == 0) |
331 | return; | 331 | return; |
332 | 332 | ||
@@ -340,7 +340,7 @@ static void __init build_device_resources(struct of_device *op, | |||
340 | if (num_reg > PROMREG_MAX) { | 340 | if (num_reg > PROMREG_MAX) { |
341 | printk(KERN_WARNING "%s: Too many regs (%d), " | 341 | printk(KERN_WARNING "%s: Too many regs (%d), " |
342 | "limiting to %d.\n", | 342 | "limiting to %d.\n", |
343 | op->node->full_name, num_reg, PROMREG_MAX); | 343 | op->dev.of_node->full_name, num_reg, PROMREG_MAX); |
344 | num_reg = PROMREG_MAX; | 344 | num_reg = PROMREG_MAX; |
345 | } | 345 | } |
346 | 346 | ||
@@ -348,8 +348,8 @@ static void __init build_device_resources(struct of_device *op, | |||
348 | struct resource *r = &op->resource[index]; | 348 | struct resource *r = &op->resource[index]; |
349 | u32 addr[OF_MAX_ADDR_CELLS]; | 349 | u32 addr[OF_MAX_ADDR_CELLS]; |
350 | const u32 *reg = (preg + (index * ((na + ns) * 4))); | 350 | const u32 *reg = (preg + (index * ((na + ns) * 4))); |
351 | struct device_node *dp = op->node; | 351 | struct device_node *dp = op->dev.of_node; |
352 | struct device_node *pp = p_op->node; | 352 | struct device_node *pp = p_op->dev.of_node; |
353 | struct of_bus *pbus, *dbus; | 353 | struct of_bus *pbus, *dbus; |
354 | u64 size, result = OF_BAD_ADDR; | 354 | u64 size, result = OF_BAD_ADDR; |
355 | unsigned long flags; | 355 | unsigned long flags; |
@@ -397,7 +397,7 @@ static void __init build_device_resources(struct of_device *op, | |||
397 | 397 | ||
398 | if (of_resource_verbose) | 398 | if (of_resource_verbose) |
399 | printk("%s reg[%d] -> %llx\n", | 399 | printk("%s reg[%d] -> %llx\n", |
400 | op->node->full_name, index, | 400 | op->dev.of_node->full_name, index, |
401 | result); | 401 | result); |
402 | 402 | ||
403 | if (result != OF_BAD_ADDR) { | 403 | if (result != OF_BAD_ADDR) { |
@@ -408,7 +408,7 @@ static void __init build_device_resources(struct of_device *op, | |||
408 | r->end = result + size - 1; | 408 | r->end = result + size - 1; |
409 | r->flags = flags; | 409 | r->flags = flags; |
410 | } | 410 | } |
411 | r->name = op->node->name; | 411 | r->name = op->dev.of_node->name; |
412 | } | 412 | } |
413 | } | 413 | } |
414 | 414 | ||
@@ -530,7 +530,7 @@ static unsigned int __init build_one_device_irq(struct of_device *op, | |||
530 | struct device *parent, | 530 | struct device *parent, |
531 | unsigned int irq) | 531 | unsigned int irq) |
532 | { | 532 | { |
533 | struct device_node *dp = op->node; | 533 | struct device_node *dp = op->dev.of_node; |
534 | struct device_node *pp, *ip; | 534 | struct device_node *pp, *ip; |
535 | unsigned int orig_irq = irq; | 535 | unsigned int orig_irq = irq; |
536 | int nid; | 536 | int nid; |
@@ -575,7 +575,7 @@ static unsigned int __init build_one_device_irq(struct of_device *op, | |||
575 | 575 | ||
576 | if (of_irq_verbose) | 576 | if (of_irq_verbose) |
577 | printk("%s: Apply [%s:%x] imap --> [%s:%x]\n", | 577 | printk("%s: Apply [%s:%x] imap --> [%s:%x]\n", |
578 | op->node->full_name, | 578 | op->dev.of_node->full_name, |
579 | pp->full_name, this_orig_irq, | 579 | pp->full_name, this_orig_irq, |
580 | (iret ? iret->full_name : "NULL"), irq); | 580 | (iret ? iret->full_name : "NULL"), irq); |
581 | 581 | ||
@@ -594,7 +594,7 @@ static unsigned int __init build_one_device_irq(struct of_device *op, | |||
594 | if (of_irq_verbose) | 594 | if (of_irq_verbose) |
595 | printk("%s: PCI swizzle [%s] " | 595 | printk("%s: PCI swizzle [%s] " |
596 | "%x --> %x\n", | 596 | "%x --> %x\n", |
597 | op->node->full_name, | 597 | op->dev.of_node->full_name, |
598 | pp->full_name, this_orig_irq, | 598 | pp->full_name, this_orig_irq, |
599 | irq); | 599 | irq); |
600 | 600 | ||
@@ -611,11 +611,11 @@ static unsigned int __init build_one_device_irq(struct of_device *op, | |||
611 | if (!ip) | 611 | if (!ip) |
612 | return orig_irq; | 612 | return orig_irq; |
613 | 613 | ||
614 | irq = ip->irq_trans->irq_build(op->node, irq, | 614 | irq = ip->irq_trans->irq_build(op->dev.of_node, irq, |
615 | ip->irq_trans->data); | 615 | ip->irq_trans->data); |
616 | if (of_irq_verbose) | 616 | if (of_irq_verbose) |
617 | printk("%s: Apply IRQ trans [%s] %x --> %x\n", | 617 | printk("%s: Apply IRQ trans [%s] %x --> %x\n", |
618 | op->node->full_name, ip->full_name, orig_irq, irq); | 618 | op->dev.of_node->full_name, ip->full_name, orig_irq, irq); |
619 | 619 | ||
620 | out: | 620 | out: |
621 | nid = of_node_to_nid(dp); | 621 | nid = of_node_to_nid(dp); |
@@ -640,10 +640,9 @@ static struct of_device * __init scan_one_device(struct device_node *dp, | |||
640 | return NULL; | 640 | return NULL; |
641 | 641 | ||
642 | sd = &op->dev.archdata; | 642 | sd = &op->dev.archdata; |
643 | sd->prom_node = dp; | ||
644 | sd->op = op; | 643 | sd->op = op; |
645 | 644 | ||
646 | op->node = dp; | 645 | op->dev.of_node = dp; |
647 | 646 | ||
648 | op->clock_freq = of_getintprop_default(dp, "clock-frequency", | 647 | op->clock_freq = of_getintprop_default(dp, "clock-frequency", |
649 | (25*1000*1000)); | 648 | (25*1000*1000)); |
diff --git a/arch/sparc/kernel/of_device_common.c b/arch/sparc/kernel/of_device_common.c index 0247e68210b3..10c6c36a6e75 100644 --- a/arch/sparc/kernel/of_device_common.c +++ b/arch/sparc/kernel/of_device_common.c | |||
@@ -16,7 +16,7 @@ static int node_match(struct device *dev, void *data) | |||
16 | struct of_device *op = to_of_device(dev); | 16 | struct of_device *op = to_of_device(dev); |
17 | struct device_node *dp = data; | 17 | struct device_node *dp = data; |
18 | 18 | ||
19 | return (op->node == dp); | 19 | return (op->dev.of_node == dp); |
20 | } | 20 | } |
21 | 21 | ||
22 | struct of_device *of_find_device_by_node(struct device_node *dp) | 22 | struct of_device *of_find_device_by_node(struct device_node *dp) |
@@ -48,7 +48,7 @@ EXPORT_SYMBOL(irq_of_parse_and_map); | |||
48 | void of_propagate_archdata(struct of_device *bus) | 48 | void of_propagate_archdata(struct of_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->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) { |
diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c index 5ac539a5930f..8a8363adb8bd 100644 --- a/arch/sparc/kernel/pci.c +++ b/arch/sparc/kernel/pci.c | |||
@@ -261,7 +261,6 @@ static struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm, | |||
261 | sd->iommu = pbm->iommu; | 261 | sd->iommu = pbm->iommu; |
262 | sd->stc = &pbm->stc; | 262 | sd->stc = &pbm->stc; |
263 | sd->host_controller = pbm; | 263 | sd->host_controller = pbm; |
264 | sd->prom_node = node; | ||
265 | sd->op = op = of_find_device_by_node(node); | 264 | sd->op = op = of_find_device_by_node(node); |
266 | sd->numa_node = pbm->numa_node; | 265 | sd->numa_node = pbm->numa_node; |
267 | 266 | ||
@@ -285,6 +284,7 @@ static struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm, | |||
285 | dev->sysdata = node; | 284 | dev->sysdata = node; |
286 | dev->dev.parent = bus->bridge; | 285 | dev->dev.parent = bus->bridge; |
287 | dev->dev.bus = &pci_bus_type; | 286 | dev->dev.bus = &pci_bus_type; |
287 | dev->dev.of_node = node; | ||
288 | dev->devfn = devfn; | 288 | dev->devfn = devfn; |
289 | dev->multifunction = 0; /* maybe a lie? */ | 289 | dev->multifunction = 0; /* maybe a lie? */ |
290 | set_pcie_port_type(dev); | 290 | set_pcie_port_type(dev); |
@@ -653,7 +653,7 @@ show_pciobppath_attr(struct device * dev, struct device_attribute * attr, char * | |||
653 | struct device_node *dp; | 653 | struct device_node *dp; |
654 | 654 | ||
655 | pdev = to_pci_dev(dev); | 655 | pdev = to_pci_dev(dev); |
656 | dp = pdev->dev.archdata.prom_node; | 656 | dp = pdev->dev.of_node; |
657 | 657 | ||
658 | return snprintf (buf, PAGE_SIZE, "%s\n", dp->full_name); | 658 | return snprintf (buf, PAGE_SIZE, "%s\n", dp->full_name); |
659 | } | 659 | } |
@@ -683,7 +683,7 @@ static void __devinit pci_bus_register_of_sysfs(struct pci_bus *bus) | |||
683 | struct pci_bus * __devinit pci_scan_one_pbm(struct pci_pbm_info *pbm, | 683 | struct pci_bus * __devinit pci_scan_one_pbm(struct pci_pbm_info *pbm, |
684 | struct device *parent) | 684 | struct device *parent) |
685 | { | 685 | { |
686 | struct device_node *node = pbm->op->node; | 686 | struct device_node *node = pbm->op->dev.of_node; |
687 | struct pci_bus *bus; | 687 | struct pci_bus *bus; |
688 | 688 | ||
689 | printk("PCI: Scanning PBM %s\n", node->full_name); | 689 | printk("PCI: Scanning PBM %s\n", node->full_name); |
@@ -1022,7 +1022,7 @@ void arch_teardown_msi_irq(unsigned int virt_irq) | |||
1022 | 1022 | ||
1023 | struct device_node *pci_device_to_OF_node(struct pci_dev *pdev) | 1023 | struct device_node *pci_device_to_OF_node(struct pci_dev *pdev) |
1024 | { | 1024 | { |
1025 | return pdev->dev.archdata.prom_node; | 1025 | return pdev->dev.of_node; |
1026 | } | 1026 | } |
1027 | EXPORT_SYMBOL(pci_device_to_OF_node); | 1027 | EXPORT_SYMBOL(pci_device_to_OF_node); |
1028 | 1028 | ||
@@ -1151,15 +1151,13 @@ static int __init of_pci_slot_init(void) | |||
1151 | struct device_node *node; | 1151 | struct device_node *node; |
1152 | 1152 | ||
1153 | if (pbus->self) { | 1153 | if (pbus->self) { |
1154 | struct dev_archdata *sd = pbus->self->sysdata; | ||
1155 | |||
1156 | /* PCI->PCI bridge */ | 1154 | /* PCI->PCI bridge */ |
1157 | node = sd->prom_node; | 1155 | node = pbus->self->dev.of_node; |
1158 | } else { | 1156 | } else { |
1159 | struct pci_pbm_info *pbm = pbus->sysdata; | 1157 | struct pci_pbm_info *pbm = pbus->sysdata; |
1160 | 1158 | ||
1161 | /* Host PCI controller */ | 1159 | /* Host PCI controller */ |
1162 | node = pbm->op->node; | 1160 | node = pbm->op->dev.of_node; |
1163 | } | 1161 | } |
1164 | 1162 | ||
1165 | pci_bus_slot_names(node, pbus); | 1163 | pci_bus_slot_names(node, pbus); |
diff --git a/arch/sparc/kernel/pci_common.c b/arch/sparc/kernel/pci_common.c index 8a000583b5cf..6c7a33af3ba6 100644 --- a/arch/sparc/kernel/pci_common.c +++ b/arch/sparc/kernel/pci_common.c | |||
@@ -314,12 +314,12 @@ struct pci_ops sun4v_pci_ops = { | |||
314 | 314 | ||
315 | void pci_get_pbm_props(struct pci_pbm_info *pbm) | 315 | void pci_get_pbm_props(struct pci_pbm_info *pbm) |
316 | { | 316 | { |
317 | const u32 *val = of_get_property(pbm->op->node, "bus-range", NULL); | 317 | const u32 *val = of_get_property(pbm->op->dev.of_node, "bus-range", NULL); |
318 | 318 | ||
319 | pbm->pci_first_busno = val[0]; | 319 | pbm->pci_first_busno = val[0]; |
320 | pbm->pci_last_busno = val[1]; | 320 | pbm->pci_last_busno = val[1]; |
321 | 321 | ||
322 | val = of_get_property(pbm->op->node, "ino-bitmap", NULL); | 322 | val = of_get_property(pbm->op->dev.of_node, "ino-bitmap", NULL); |
323 | if (val) { | 323 | if (val) { |
324 | pbm->ino_bitmap = (((u64)val[1] << 32UL) | | 324 | pbm->ino_bitmap = (((u64)val[1] << 32UL) | |
325 | ((u64)val[0] << 0UL)); | 325 | ((u64)val[0] << 0UL)); |
@@ -365,7 +365,8 @@ static void pci_register_legacy_regions(struct resource *io_res, | |||
365 | 365 | ||
366 | static void pci_register_iommu_region(struct pci_pbm_info *pbm) | 366 | static void pci_register_iommu_region(struct pci_pbm_info *pbm) |
367 | { | 367 | { |
368 | const u32 *vdma = of_get_property(pbm->op->node, "virtual-dma", NULL); | 368 | const u32 *vdma = of_get_property(pbm->op->dev.of_node, "virtual-dma", |
369 | NULL); | ||
369 | 370 | ||
370 | if (vdma) { | 371 | if (vdma) { |
371 | struct resource *rp = kzalloc(sizeof(*rp), GFP_KERNEL); | 372 | struct resource *rp = kzalloc(sizeof(*rp), GFP_KERNEL); |
@@ -394,7 +395,7 @@ void pci_determine_mem_io_space(struct pci_pbm_info *pbm) | |||
394 | int num_pbm_ranges; | 395 | int num_pbm_ranges; |
395 | 396 | ||
396 | saw_mem = saw_io = 0; | 397 | saw_mem = saw_io = 0; |
397 | pbm_ranges = of_get_property(pbm->op->node, "ranges", &i); | 398 | pbm_ranges = of_get_property(pbm->op->dev.of_node, "ranges", &i); |
398 | if (!pbm_ranges) { | 399 | if (!pbm_ranges) { |
399 | prom_printf("PCI: Fatal error, missing PBM ranges property " | 400 | prom_printf("PCI: Fatal error, missing PBM ranges property " |
400 | " for %s\n", | 401 | " for %s\n", |
diff --git a/arch/sparc/kernel/pci_fire.c b/arch/sparc/kernel/pci_fire.c index d53f45bc7dda..51cfa09e392a 100644 --- a/arch/sparc/kernel/pci_fire.c +++ b/arch/sparc/kernel/pci_fire.c | |||
@@ -413,7 +413,7 @@ static int __devinit pci_fire_pbm_init(struct pci_pbm_info *pbm, | |||
413 | struct of_device *op, u32 portid) | 413 | struct of_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->node; | 416 | struct device_node *dp = op->dev.of_node; |
417 | int err; | 417 | int err; |
418 | 418 | ||
419 | pbm->numa_node = -1; | 419 | pbm->numa_node = -1; |
@@ -458,7 +458,7 @@ static int __devinit pci_fire_pbm_init(struct pci_pbm_info *pbm, | |||
458 | static int __devinit fire_probe(struct of_device *op, | 458 | static int __devinit fire_probe(struct of_device *op, |
459 | const struct of_device_id *match) | 459 | const struct of_device_id *match) |
460 | { | 460 | { |
461 | struct device_node *dp = op->node; | 461 | struct device_node *dp = op->dev.of_node; |
462 | struct pci_pbm_info *pbm; | 462 | struct pci_pbm_info *pbm; |
463 | struct iommu *iommu; | 463 | struct iommu *iommu; |
464 | u32 portid; | 464 | u32 portid; |
@@ -508,8 +508,11 @@ static struct of_device_id __initdata fire_match[] = { | |||
508 | }; | 508 | }; |
509 | 509 | ||
510 | static struct of_platform_driver fire_driver = { | 510 | static struct of_platform_driver fire_driver = { |
511 | .name = DRIVER_NAME, | 511 | .driver = { |
512 | .match_table = fire_match, | 512 | .name = DRIVER_NAME, |
513 | .owner = THIS_MODULE, | ||
514 | .of_match_table = fire_match, | ||
515 | }, | ||
513 | .probe = fire_probe, | 516 | .probe = fire_probe, |
514 | }; | 517 | }; |
515 | 518 | ||
diff --git a/arch/sparc/kernel/pci_msi.c b/arch/sparc/kernel/pci_msi.c index e0ef847219c3..548b8ca9c210 100644 --- a/arch/sparc/kernel/pci_msi.c +++ b/arch/sparc/kernel/pci_msi.c | |||
@@ -324,7 +324,7 @@ void sparc64_pbm_msi_init(struct pci_pbm_info *pbm, | |||
324 | const u32 *val; | 324 | const u32 *val; |
325 | int len; | 325 | int len; |
326 | 326 | ||
327 | val = of_get_property(pbm->op->node, "#msi-eqs", &len); | 327 | val = of_get_property(pbm->op->dev.of_node, "#msi-eqs", &len); |
328 | if (!val || len != 4) | 328 | if (!val || len != 4) |
329 | goto no_msi; | 329 | goto no_msi; |
330 | pbm->msiq_num = *val; | 330 | pbm->msiq_num = *val; |
@@ -347,16 +347,16 @@ void sparc64_pbm_msi_init(struct pci_pbm_info *pbm, | |||
347 | u32 msi64_len; | 347 | u32 msi64_len; |
348 | } *arng; | 348 | } *arng; |
349 | 349 | ||
350 | val = of_get_property(pbm->op->node, "msi-eq-size", &len); | 350 | val = of_get_property(pbm->op->dev.of_node, "msi-eq-size", &len); |
351 | if (!val || len != 4) | 351 | if (!val || len != 4) |
352 | goto no_msi; | 352 | goto no_msi; |
353 | 353 | ||
354 | pbm->msiq_ent_count = *val; | 354 | pbm->msiq_ent_count = *val; |
355 | 355 | ||
356 | mqp = of_get_property(pbm->op->node, | 356 | mqp = of_get_property(pbm->op->dev.of_node, |
357 | "msi-eq-to-devino", &len); | 357 | "msi-eq-to-devino", &len); |
358 | if (!mqp) | 358 | if (!mqp) |
359 | mqp = of_get_property(pbm->op->node, | 359 | mqp = of_get_property(pbm->op->dev.of_node, |
360 | "msi-eq-devino", &len); | 360 | "msi-eq-devino", &len); |
361 | if (!mqp || len != sizeof(struct msiq_prop)) | 361 | if (!mqp || len != sizeof(struct msiq_prop)) |
362 | goto no_msi; | 362 | goto no_msi; |
@@ -364,27 +364,27 @@ void sparc64_pbm_msi_init(struct pci_pbm_info *pbm, | |||
364 | pbm->msiq_first = mqp->first_msiq; | 364 | pbm->msiq_first = mqp->first_msiq; |
365 | pbm->msiq_first_devino = mqp->first_devino; | 365 | pbm->msiq_first_devino = mqp->first_devino; |
366 | 366 | ||
367 | val = of_get_property(pbm->op->node, "#msi", &len); | 367 | val = of_get_property(pbm->op->dev.of_node, "#msi", &len); |
368 | if (!val || len != 4) | 368 | if (!val || len != 4) |
369 | goto no_msi; | 369 | goto no_msi; |
370 | pbm->msi_num = *val; | 370 | pbm->msi_num = *val; |
371 | 371 | ||
372 | mrng = of_get_property(pbm->op->node, "msi-ranges", &len); | 372 | mrng = of_get_property(pbm->op->dev.of_node, "msi-ranges", &len); |
373 | if (!mrng || len != sizeof(struct msi_range_prop)) | 373 | if (!mrng || len != sizeof(struct msi_range_prop)) |
374 | goto no_msi; | 374 | goto no_msi; |
375 | pbm->msi_first = mrng->first_msi; | 375 | pbm->msi_first = mrng->first_msi; |
376 | 376 | ||
377 | val = of_get_property(pbm->op->node, "msi-data-mask", &len); | 377 | val = of_get_property(pbm->op->dev.of_node, "msi-data-mask", &len); |
378 | if (!val || len != 4) | 378 | if (!val || len != 4) |
379 | goto no_msi; | 379 | goto no_msi; |
380 | pbm->msi_data_mask = *val; | 380 | pbm->msi_data_mask = *val; |
381 | 381 | ||
382 | val = of_get_property(pbm->op->node, "msix-data-width", &len); | 382 | val = of_get_property(pbm->op->dev.of_node, "msix-data-width", &len); |
383 | if (!val || len != 4) | 383 | if (!val || len != 4) |
384 | goto no_msi; | 384 | goto no_msi; |
385 | pbm->msix_data_width = *val; | 385 | pbm->msix_data_width = *val; |
386 | 386 | ||
387 | arng = of_get_property(pbm->op->node, "msi-address-ranges", | 387 | arng = of_get_property(pbm->op->dev.of_node, "msi-address-ranges", |
388 | &len); | 388 | &len); |
389 | if (!arng || len != sizeof(struct addr_range_prop)) | 389 | if (!arng || len != sizeof(struct addr_range_prop)) |
390 | goto no_msi; | 390 | goto no_msi; |
diff --git a/arch/sparc/kernel/pci_psycho.c b/arch/sparc/kernel/pci_psycho.c index 142b9d6984a8..558a70512824 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 */ |
286 | static void psycho_register_error_handlers(struct pci_pbm_info *pbm) | 286 | static void psycho_register_error_handlers(struct pci_pbm_info *pbm) |
287 | { | 287 | { |
288 | struct of_device *op = of_find_device_by_node(pbm->op->node); | 288 | struct of_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; |
@@ -507,7 +507,7 @@ static int __devinit psycho_probe(struct of_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; |
510 | struct device_node *dp = op->node; | 510 | struct device_node *dp = op->dev.of_node; |
511 | struct pci_pbm_info *pbm; | 511 | struct pci_pbm_info *pbm; |
512 | struct iommu *iommu; | 512 | struct iommu *iommu; |
513 | int is_pbm_a, err; | 513 | int is_pbm_a, err; |
@@ -602,8 +602,11 @@ static struct of_device_id __initdata psycho_match[] = { | |||
602 | }; | 602 | }; |
603 | 603 | ||
604 | static struct of_platform_driver psycho_driver = { | 604 | static struct of_platform_driver psycho_driver = { |
605 | .name = DRIVER_NAME, | 605 | .driver = { |
606 | .match_table = psycho_match, | 606 | .name = DRIVER_NAME, |
607 | .owner = THIS_MODULE, | ||
608 | .of_match_table = psycho_match, | ||
609 | }, | ||
607 | .probe = psycho_probe, | 610 | .probe = psycho_probe, |
608 | }; | 611 | }; |
609 | 612 | ||
diff --git a/arch/sparc/kernel/pci_sabre.c b/arch/sparc/kernel/pci_sabre.c index ba6fbeba3e2c..6dad8e3b7506 100644 --- a/arch/sparc/kernel/pci_sabre.c +++ b/arch/sparc/kernel/pci_sabre.c | |||
@@ -310,7 +310,7 @@ static irqreturn_t sabre_ce_intr(int irq, void *dev_id) | |||
310 | 310 | ||
311 | static void sabre_register_error_handlers(struct pci_pbm_info *pbm) | 311 | static void sabre_register_error_handlers(struct pci_pbm_info *pbm) |
312 | { | 312 | { |
313 | struct device_node *dp = pbm->op->node; | 313 | struct device_node *dp = pbm->op->dev.of_node; |
314 | struct of_device *op; | 314 | struct of_device *op; |
315 | unsigned long base = pbm->controller_regs; | 315 | unsigned long base = pbm->controller_regs; |
316 | u64 tmp; | 316 | u64 tmp; |
@@ -456,7 +456,7 @@ static int __devinit sabre_probe(struct of_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; |
459 | struct device_node *dp = op->node; | 459 | struct device_node *dp = op->dev.of_node; |
460 | struct pci_pbm_info *pbm; | 460 | struct pci_pbm_info *pbm; |
461 | u32 upa_portid, dma_mask; | 461 | u32 upa_portid, dma_mask; |
462 | struct iommu *iommu; | 462 | struct iommu *iommu; |
@@ -596,8 +596,11 @@ static struct of_device_id __initdata sabre_match[] = { | |||
596 | }; | 596 | }; |
597 | 597 | ||
598 | static struct of_platform_driver sabre_driver = { | 598 | static struct of_platform_driver sabre_driver = { |
599 | .name = DRIVER_NAME, | 599 | .driver = { |
600 | .match_table = sabre_match, | 600 | .name = DRIVER_NAME, |
601 | .owner = THIS_MODULE, | ||
602 | .of_match_table = sabre_match, | ||
603 | }, | ||
601 | .probe = sabre_probe, | 604 | .probe = sabre_probe, |
602 | }; | 605 | }; |
603 | 606 | ||
diff --git a/arch/sparc/kernel/pci_schizo.c b/arch/sparc/kernel/pci_schizo.c index 2b5cdde77af7..97a1ae2e1c02 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 | */ |
845 | static void tomatillo_register_error_handlers(struct pci_pbm_info *pbm) | 845 | static void tomatillo_register_error_handlers(struct pci_pbm_info *pbm) |
846 | { | 846 | { |
847 | struct of_device *op = of_find_device_by_node(pbm->op->node); | 847 | struct of_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 | ||
940 | static void schizo_register_error_handlers(struct pci_pbm_info *pbm) | 940 | static void schizo_register_error_handlers(struct pci_pbm_info *pbm) |
941 | { | 941 | { |
942 | struct of_device *op = of_find_device_by_node(pbm->op->node); | 942 | struct of_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 | ||
@@ -1068,7 +1068,7 @@ static void __devinit schizo_scan_bus(struct pci_pbm_info *pbm, | |||
1068 | { | 1068 | { |
1069 | pbm_config_busmastering(pbm); | 1069 | pbm_config_busmastering(pbm); |
1070 | pbm->is_66mhz_capable = | 1070 | pbm->is_66mhz_capable = |
1071 | (of_find_property(pbm->op->node, "66mhz-capable", NULL) | 1071 | (of_find_property(pbm->op->dev.of_node, "66mhz-capable", NULL) |
1072 | != NULL); | 1072 | != NULL); |
1073 | 1073 | ||
1074 | pbm->pci_bus = pci_scan_one_pbm(pbm, parent); | 1074 | pbm->pci_bus = pci_scan_one_pbm(pbm, parent); |
@@ -1138,7 +1138,7 @@ static int schizo_pbm_iommu_init(struct pci_pbm_info *pbm) | |||
1138 | u32 dma_mask; | 1138 | u32 dma_mask; |
1139 | u64 control; | 1139 | u64 control; |
1140 | 1140 | ||
1141 | vdma = of_get_property(pbm->op->node, "virtual-dma", NULL); | 1141 | vdma = of_get_property(pbm->op->dev.of_node, "virtual-dma", NULL); |
1142 | if (!vdma) | 1142 | if (!vdma) |
1143 | vdma = vdma_default; | 1143 | vdma = vdma_default; |
1144 | 1144 | ||
@@ -1268,7 +1268,7 @@ static void schizo_pbm_hw_init(struct pci_pbm_info *pbm) | |||
1268 | pbm->chip_version >= 0x2) | 1268 | pbm->chip_version >= 0x2) |
1269 | tmp |= 0x3UL << SCHIZO_PCICTRL_PTO_SHIFT; | 1269 | tmp |= 0x3UL << SCHIZO_PCICTRL_PTO_SHIFT; |
1270 | 1270 | ||
1271 | if (!of_find_property(pbm->op->node, "no-bus-parking", NULL)) | 1271 | if (!of_find_property(pbm->op->dev.of_node, "no-bus-parking", NULL)) |
1272 | tmp |= SCHIZO_PCICTRL_PARK; | 1272 | tmp |= SCHIZO_PCICTRL_PARK; |
1273 | else | 1273 | else |
1274 | tmp &= ~SCHIZO_PCICTRL_PARK; | 1274 | tmp &= ~SCHIZO_PCICTRL_PARK; |
@@ -1311,7 +1311,7 @@ static int __devinit schizo_pbm_init(struct pci_pbm_info *pbm, | |||
1311 | int chip_type) | 1311 | int chip_type) |
1312 | { | 1312 | { |
1313 | const struct linux_prom64_registers *regs; | 1313 | const struct linux_prom64_registers *regs; |
1314 | struct device_node *dp = op->node; | 1314 | struct device_node *dp = op->dev.of_node; |
1315 | const char *chipset_name; | 1315 | const char *chipset_name; |
1316 | int is_pbm_a, err; | 1316 | int is_pbm_a, err; |
1317 | 1317 | ||
@@ -1415,7 +1415,7 @@ static struct pci_pbm_info * __devinit schizo_find_sibling(u32 portid, | |||
1415 | 1415 | ||
1416 | static int __devinit __schizo_init(struct of_device *op, unsigned long chip_type) | 1416 | static int __devinit __schizo_init(struct of_device *op, unsigned long chip_type) |
1417 | { | 1417 | { |
1418 | struct device_node *dp = op->node; | 1418 | struct device_node *dp = op->dev.of_node; |
1419 | struct pci_pbm_info *pbm; | 1419 | struct pci_pbm_info *pbm; |
1420 | struct iommu *iommu; | 1420 | struct iommu *iommu; |
1421 | u32 portid; | 1421 | u32 portid; |
@@ -1491,8 +1491,11 @@ static struct of_device_id __initdata schizo_match[] = { | |||
1491 | }; | 1491 | }; |
1492 | 1492 | ||
1493 | static struct of_platform_driver schizo_driver = { | 1493 | static struct of_platform_driver schizo_driver = { |
1494 | .name = DRIVER_NAME, | 1494 | .driver = { |
1495 | .match_table = schizo_match, | 1495 | .name = DRIVER_NAME, |
1496 | .owner = THIS_MODULE, | ||
1497 | .of_match_table = schizo_match, | ||
1498 | }, | ||
1496 | .probe = schizo_probe, | 1499 | .probe = schizo_probe, |
1497 | }; | 1500 | }; |
1498 | 1501 | ||
diff --git a/arch/sparc/kernel/pci_sun4v.c b/arch/sparc/kernel/pci_sun4v.c index 23c33ff9c31e..a24af6f7e17f 100644 --- a/arch/sparc/kernel/pci_sun4v.c +++ b/arch/sparc/kernel/pci_sun4v.c | |||
@@ -540,7 +540,7 @@ static void __devinit pci_sun4v_scan_bus(struct pci_pbm_info *pbm, | |||
540 | struct property *prop; | 540 | struct property *prop; |
541 | struct device_node *dp; | 541 | struct device_node *dp; |
542 | 542 | ||
543 | dp = pbm->op->node; | 543 | dp = pbm->op->dev.of_node; |
544 | prop = of_find_property(dp, "66mhz-capable", NULL); | 544 | prop = of_find_property(dp, "66mhz-capable", NULL); |
545 | pbm->is_66mhz_capable = (prop != NULL); | 545 | pbm->is_66mhz_capable = (prop != NULL); |
546 | pbm->pci_bus = pci_scan_one_pbm(pbm, parent); | 546 | pbm->pci_bus = pci_scan_one_pbm(pbm, parent); |
@@ -584,7 +584,7 @@ static int __devinit pci_sun4v_iommu_init(struct pci_pbm_info *pbm) | |||
584 | u32 dma_mask, dma_offset; | 584 | u32 dma_mask, dma_offset; |
585 | const u32 *vdma; | 585 | const u32 *vdma; |
586 | 586 | ||
587 | vdma = of_get_property(pbm->op->node, "virtual-dma", NULL); | 587 | vdma = of_get_property(pbm->op->dev.of_node, "virtual-dma", NULL); |
588 | if (!vdma) | 588 | if (!vdma) |
589 | vdma = vdma_default; | 589 | vdma = vdma_default; |
590 | 590 | ||
@@ -881,7 +881,7 @@ static void pci_sun4v_msi_init(struct pci_pbm_info *pbm) | |||
881 | static int __devinit pci_sun4v_pbm_init(struct pci_pbm_info *pbm, | 881 | static int __devinit pci_sun4v_pbm_init(struct pci_pbm_info *pbm, |
882 | struct of_device *op, u32 devhandle) | 882 | struct of_device *op, u32 devhandle) |
883 | { | 883 | { |
884 | struct device_node *dp = op->node; | 884 | struct device_node *dp = op->dev.of_node; |
885 | int err; | 885 | int err; |
886 | 886 | ||
887 | pbm->numa_node = of_node_to_nid(dp); | 887 | pbm->numa_node = of_node_to_nid(dp); |
@@ -929,7 +929,7 @@ static int __devinit pci_sun4v_probe(struct of_device *op, | |||
929 | u32 devhandle; | 929 | u32 devhandle; |
930 | int i, err; | 930 | int i, err; |
931 | 931 | ||
932 | dp = op->node; | 932 | dp = op->dev.of_node; |
933 | 933 | ||
934 | if (!hvapi_negotiated++) { | 934 | if (!hvapi_negotiated++) { |
935 | err = sun4v_hvapi_register(HV_GRP_PCI, | 935 | err = sun4v_hvapi_register(HV_GRP_PCI, |
@@ -1009,8 +1009,11 @@ static struct of_device_id __initdata pci_sun4v_match[] = { | |||
1009 | }; | 1009 | }; |
1010 | 1010 | ||
1011 | static struct of_platform_driver pci_sun4v_driver = { | 1011 | static struct of_platform_driver pci_sun4v_driver = { |
1012 | .name = DRIVER_NAME, | 1012 | .driver = { |
1013 | .match_table = pci_sun4v_match, | 1013 | .name = DRIVER_NAME, |
1014 | .owner = THIS_MODULE, | ||
1015 | .of_match_table = pci_sun4v_match, | ||
1016 | }, | ||
1014 | .probe = pci_sun4v_probe, | 1017 | .probe = pci_sun4v_probe, |
1015 | }; | 1018 | }; |
1016 | 1019 | ||
diff --git a/arch/sparc/kernel/perf_event.c b/arch/sparc/kernel/perf_event.c index 34ce49f80eac..0ec92c8861dd 100644 --- a/arch/sparc/kernel/perf_event.c +++ b/arch/sparc/kernel/perf_event.c | |||
@@ -92,6 +92,8 @@ struct cpu_hw_events { | |||
92 | 92 | ||
93 | /* Enabled/disable state. */ | 93 | /* Enabled/disable state. */ |
94 | int enabled; | 94 | int enabled; |
95 | |||
96 | unsigned int group_flag; | ||
95 | }; | 97 | }; |
96 | DEFINE_PER_CPU(struct cpu_hw_events, cpu_hw_events) = { .enabled = 1, }; | 98 | DEFINE_PER_CPU(struct cpu_hw_events, cpu_hw_events) = { .enabled = 1, }; |
97 | 99 | ||
@@ -981,53 +983,6 @@ static int collect_events(struct perf_event *group, int max_count, | |||
981 | return n; | 983 | return n; |
982 | } | 984 | } |
983 | 985 | ||
984 | static void event_sched_in(struct perf_event *event) | ||
985 | { | ||
986 | event->state = PERF_EVENT_STATE_ACTIVE; | ||
987 | event->oncpu = smp_processor_id(); | ||
988 | event->tstamp_running += event->ctx->time - event->tstamp_stopped; | ||
989 | if (is_software_event(event)) | ||
990 | event->pmu->enable(event); | ||
991 | } | ||
992 | |||
993 | int hw_perf_group_sched_in(struct perf_event *group_leader, | ||
994 | struct perf_cpu_context *cpuctx, | ||
995 | struct perf_event_context *ctx) | ||
996 | { | ||
997 | struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); | ||
998 | struct perf_event *sub; | ||
999 | int n0, n; | ||
1000 | |||
1001 | if (!sparc_pmu) | ||
1002 | return 0; | ||
1003 | |||
1004 | n0 = cpuc->n_events; | ||
1005 | n = collect_events(group_leader, perf_max_events - n0, | ||
1006 | &cpuc->event[n0], &cpuc->events[n0], | ||
1007 | &cpuc->current_idx[n0]); | ||
1008 | if (n < 0) | ||
1009 | return -EAGAIN; | ||
1010 | if (check_excludes(cpuc->event, n0, n)) | ||
1011 | return -EINVAL; | ||
1012 | if (sparc_check_constraints(cpuc->event, cpuc->events, n + n0)) | ||
1013 | return -EAGAIN; | ||
1014 | cpuc->n_events = n0 + n; | ||
1015 | cpuc->n_added += n; | ||
1016 | |||
1017 | cpuctx->active_oncpu += n; | ||
1018 | n = 1; | ||
1019 | event_sched_in(group_leader); | ||
1020 | list_for_each_entry(sub, &group_leader->sibling_list, group_entry) { | ||
1021 | if (sub->state != PERF_EVENT_STATE_OFF) { | ||
1022 | event_sched_in(sub); | ||
1023 | n++; | ||
1024 | } | ||
1025 | } | ||
1026 | ctx->nr_active += n; | ||
1027 | |||
1028 | return 1; | ||
1029 | } | ||
1030 | |||
1031 | static int sparc_pmu_enable(struct perf_event *event) | 986 | static int sparc_pmu_enable(struct perf_event *event) |
1032 | { | 987 | { |
1033 | struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); | 988 | struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); |
@@ -1045,11 +1000,20 @@ static int sparc_pmu_enable(struct perf_event *event) | |||
1045 | cpuc->events[n0] = event->hw.event_base; | 1000 | cpuc->events[n0] = event->hw.event_base; |
1046 | cpuc->current_idx[n0] = PIC_NO_INDEX; | 1001 | cpuc->current_idx[n0] = PIC_NO_INDEX; |
1047 | 1002 | ||
1003 | /* | ||
1004 | * If group events scheduling transaction was started, | ||
1005 | * skip the schedulability test here, it will be peformed | ||
1006 | * at commit time(->commit_txn) as a whole | ||
1007 | */ | ||
1008 | if (cpuc->group_flag & PERF_EVENT_TXN_STARTED) | ||
1009 | goto nocheck; | ||
1010 | |||
1048 | if (check_excludes(cpuc->event, n0, 1)) | 1011 | if (check_excludes(cpuc->event, n0, 1)) |
1049 | goto out; | 1012 | goto out; |
1050 | if (sparc_check_constraints(cpuc->event, cpuc->events, n0 + 1)) | 1013 | if (sparc_check_constraints(cpuc->event, cpuc->events, n0 + 1)) |
1051 | goto out; | 1014 | goto out; |
1052 | 1015 | ||
1016 | nocheck: | ||
1053 | cpuc->n_events++; | 1017 | cpuc->n_events++; |
1054 | cpuc->n_added++; | 1018 | cpuc->n_added++; |
1055 | 1019 | ||
@@ -1129,11 +1093,61 @@ static int __hw_perf_event_init(struct perf_event *event) | |||
1129 | return 0; | 1093 | return 0; |
1130 | } | 1094 | } |
1131 | 1095 | ||
1096 | /* | ||
1097 | * Start group events scheduling transaction | ||
1098 | * Set the flag to make pmu::enable() not perform the | ||
1099 | * schedulability test, it will be performed at commit time | ||
1100 | */ | ||
1101 | static void sparc_pmu_start_txn(const struct pmu *pmu) | ||
1102 | { | ||
1103 | struct cpu_hw_events *cpuhw = &__get_cpu_var(cpu_hw_events); | ||
1104 | |||
1105 | cpuhw->group_flag |= PERF_EVENT_TXN_STARTED; | ||
1106 | } | ||
1107 | |||
1108 | /* | ||
1109 | * Stop group events scheduling transaction | ||
1110 | * Clear the flag and pmu::enable() will perform the | ||
1111 | * schedulability test. | ||
1112 | */ | ||
1113 | static void sparc_pmu_cancel_txn(const struct pmu *pmu) | ||
1114 | { | ||
1115 | struct cpu_hw_events *cpuhw = &__get_cpu_var(cpu_hw_events); | ||
1116 | |||
1117 | cpuhw->group_flag &= ~PERF_EVENT_TXN_STARTED; | ||
1118 | } | ||
1119 | |||
1120 | /* | ||
1121 | * Commit group events scheduling transaction | ||
1122 | * Perform the group schedulability test as a whole | ||
1123 | * Return 0 if success | ||
1124 | */ | ||
1125 | static int sparc_pmu_commit_txn(const struct pmu *pmu) | ||
1126 | { | ||
1127 | struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); | ||
1128 | int n; | ||
1129 | |||
1130 | if (!sparc_pmu) | ||
1131 | return -EINVAL; | ||
1132 | |||
1133 | cpuc = &__get_cpu_var(cpu_hw_events); | ||
1134 | n = cpuc->n_events; | ||
1135 | if (check_excludes(cpuc->event, 0, n)) | ||
1136 | return -EINVAL; | ||
1137 | if (sparc_check_constraints(cpuc->event, cpuc->events, n)) | ||
1138 | return -EAGAIN; | ||
1139 | |||
1140 | return 0; | ||
1141 | } | ||
1142 | |||
1132 | static const struct pmu pmu = { | 1143 | static const struct pmu pmu = { |
1133 | .enable = sparc_pmu_enable, | 1144 | .enable = sparc_pmu_enable, |
1134 | .disable = sparc_pmu_disable, | 1145 | .disable = sparc_pmu_disable, |
1135 | .read = sparc_pmu_read, | 1146 | .read = sparc_pmu_read, |
1136 | .unthrottle = sparc_pmu_unthrottle, | 1147 | .unthrottle = sparc_pmu_unthrottle, |
1148 | .start_txn = sparc_pmu_start_txn, | ||
1149 | .cancel_txn = sparc_pmu_cancel_txn, | ||
1150 | .commit_txn = sparc_pmu_commit_txn, | ||
1137 | }; | 1151 | }; |
1138 | 1152 | ||
1139 | const struct pmu *hw_perf_event_init(struct perf_event *event) | 1153 | const struct pmu *hw_perf_event_init(struct perf_event *event) |
diff --git a/arch/sparc/kernel/pmc.c b/arch/sparc/kernel/pmc.c index 5e4563d86f19..9589d8b9b0c1 100644 --- a/arch/sparc/kernel/pmc.c +++ b/arch/sparc/kernel/pmc.c | |||
@@ -79,8 +79,11 @@ static struct of_device_id __initdata pmc_match[] = { | |||
79 | MODULE_DEVICE_TABLE(of, pmc_match); | 79 | MODULE_DEVICE_TABLE(of, pmc_match); |
80 | 80 | ||
81 | static struct of_platform_driver pmc_driver = { | 81 | static struct of_platform_driver pmc_driver = { |
82 | .name = "pmc", | 82 | .driver = { |
83 | .match_table = pmc_match, | 83 | .name = "pmc", |
84 | .owner = THIS_MODULE, | ||
85 | .of_match_table = pmc_match, | ||
86 | }, | ||
84 | .probe = pmc_probe, | 87 | .probe = pmc_probe, |
85 | }; | 88 | }; |
86 | 89 | ||
diff --git a/arch/sparc/kernel/power.c b/arch/sparc/kernel/power.c index e2a045c235a1..168d4cb63f5b 100644 --- a/arch/sparc/kernel/power.c +++ b/arch/sparc/kernel/power.c | |||
@@ -41,9 +41,9 @@ static int __devinit power_probe(struct of_device *op, const struct of_device_id | |||
41 | power_reg = of_ioremap(res, 0, 0x4, "power"); | 41 | power_reg = of_ioremap(res, 0, 0x4, "power"); |
42 | 42 | ||
43 | printk(KERN_INFO "%s: Control reg at %llx\n", | 43 | printk(KERN_INFO "%s: Control reg at %llx\n", |
44 | op->node->name, res->start); | 44 | op->dev.of_node->name, res->start); |
45 | 45 | ||
46 | if (has_button_interrupt(irq, op->node)) { | 46 | if (has_button_interrupt(irq, op->dev.of_node)) { |
47 | if (request_irq(irq, | 47 | if (request_irq(irq, |
48 | power_handler, 0, "power", NULL) < 0) | 48 | power_handler, 0, "power", NULL) < 0) |
49 | printk(KERN_ERR "power: Cannot setup IRQ handler.\n"); | 49 | printk(KERN_ERR "power: Cannot setup IRQ handler.\n"); |
@@ -60,10 +60,11 @@ static struct of_device_id __initdata power_match[] = { | |||
60 | }; | 60 | }; |
61 | 61 | ||
62 | static struct of_platform_driver power_driver = { | 62 | static struct of_platform_driver power_driver = { |
63 | .match_table = power_match, | ||
64 | .probe = power_probe, | 63 | .probe = power_probe, |
65 | .driver = { | 64 | .driver = { |
66 | .name = "power", | 65 | .name = "power", |
66 | .owner = THIS_MODULE, | ||
67 | .of_match_table = power_match, | ||
67 | }, | 68 | }, |
68 | }; | 69 | }; |
69 | 70 | ||
diff --git a/arch/sparc/kernel/psycho_common.c b/arch/sparc/kernel/psycho_common.c index 8f1478475421..3f34ac853931 100644 --- a/arch/sparc/kernel/psycho_common.c +++ b/arch/sparc/kernel/psycho_common.c | |||
@@ -450,7 +450,7 @@ int psycho_iommu_init(struct pci_pbm_info *pbm, int tsbsize, | |||
450 | void psycho_pbm_init_common(struct pci_pbm_info *pbm, struct of_device *op, | 450 | void psycho_pbm_init_common(struct pci_pbm_info *pbm, struct of_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->node; | 453 | struct device_node *dp = op->dev.of_node; |
454 | 454 | ||
455 | pbm->name = dp->full_name; | 455 | pbm->name = dp->full_name; |
456 | pbm->numa_node = -1; | 456 | pbm->numa_node = -1; |
diff --git a/arch/sparc/kernel/sbus.c b/arch/sparc/kernel/sbus.c index 406e0872504e..cfeaf04b9cdf 100644 --- a/arch/sparc/kernel/sbus.c +++ b/arch/sparc/kernel/sbus.c | |||
@@ -63,10 +63,10 @@ void sbus_set_sbus64(struct device *dev, int bursts) | |||
63 | int slot; | 63 | int slot; |
64 | u64 val; | 64 | u64 val; |
65 | 65 | ||
66 | regs = of_get_property(op->node, "reg", NULL); | 66 | regs = of_get_property(op->dev.of_node, "reg", NULL); |
67 | if (!regs) { | 67 | if (!regs) { |
68 | printk(KERN_ERR "sbus_set_sbus64: Cannot find regs for %s\n", | 68 | printk(KERN_ERR "sbus_set_sbus64: Cannot find regs for %s\n", |
69 | op->node->full_name); | 69 | op->dev.of_node->full_name); |
70 | return; | 70 | return; |
71 | } | 71 | } |
72 | slot = regs->which_io; | 72 | slot = regs->which_io; |
@@ -287,7 +287,7 @@ static irqreturn_t sysio_ue_handler(int irq, void *dev_id) | |||
287 | SYSIO_UEAFSR_SPIO | SYSIO_UEAFSR_SDRD | SYSIO_UEAFSR_SDWR); | 287 | SYSIO_UEAFSR_SPIO | SYSIO_UEAFSR_SDRD | SYSIO_UEAFSR_SDWR); |
288 | upa_writeq(error_bits, afsr_reg); | 288 | upa_writeq(error_bits, afsr_reg); |
289 | 289 | ||
290 | portid = of_getintprop_default(op->node, "portid", -1); | 290 | portid = of_getintprop_default(op->dev.of_node, "portid", -1); |
291 | 291 | ||
292 | /* Log the error. */ | 292 | /* Log the error. */ |
293 | printk("SYSIO[%x]: Uncorrectable ECC Error, primary error type[%s]\n", | 293 | printk("SYSIO[%x]: Uncorrectable ECC Error, primary error type[%s]\n", |
@@ -361,7 +361,7 @@ static irqreturn_t sysio_ce_handler(int irq, void *dev_id) | |||
361 | SYSIO_CEAFSR_SPIO | SYSIO_CEAFSR_SDRD | SYSIO_CEAFSR_SDWR); | 361 | SYSIO_CEAFSR_SPIO | SYSIO_CEAFSR_SDRD | SYSIO_CEAFSR_SDWR); |
362 | upa_writeq(error_bits, afsr_reg); | 362 | upa_writeq(error_bits, afsr_reg); |
363 | 363 | ||
364 | portid = of_getintprop_default(op->node, "portid", -1); | 364 | portid = of_getintprop_default(op->dev.of_node, "portid", -1); |
365 | 365 | ||
366 | printk("SYSIO[%x]: Correctable ECC Error, primary error type[%s]\n", | 366 | printk("SYSIO[%x]: Correctable ECC Error, primary error type[%s]\n", |
367 | portid, | 367 | portid, |
@@ -439,7 +439,7 @@ static irqreturn_t sysio_sbus_error_handler(int irq, void *dev_id) | |||
439 | SYSIO_SBAFSR_SLE | SYSIO_SBAFSR_STO | SYSIO_SBAFSR_SBERR); | 439 | SYSIO_SBAFSR_SLE | SYSIO_SBAFSR_STO | SYSIO_SBAFSR_SBERR); |
440 | upa_writeq(error_bits, afsr_reg); | 440 | upa_writeq(error_bits, afsr_reg); |
441 | 441 | ||
442 | portid = of_getintprop_default(op->node, "portid", -1); | 442 | portid = of_getintprop_default(op->dev.of_node, "portid", -1); |
443 | 443 | ||
444 | /* Log the error. */ | 444 | /* Log the error. */ |
445 | printk("SYSIO[%x]: SBUS Error, primary error type[%s] read(%d)\n", | 445 | printk("SYSIO[%x]: SBUS Error, primary error type[%s] read(%d)\n", |
@@ -496,7 +496,7 @@ static void __init sysio_register_error_handlers(struct of_device *op) | |||
496 | u64 control; | 496 | u64 control; |
497 | int portid; | 497 | int portid; |
498 | 498 | ||
499 | portid = of_getintprop_default(op->node, "portid", -1); | 499 | portid = of_getintprop_default(op->dev.of_node, "portid", -1); |
500 | 500 | ||
501 | irq = sbus_build_irq(op, SYSIO_UE_INO); | 501 | irq = sbus_build_irq(op, SYSIO_UE_INO); |
502 | if (request_irq(irq, sysio_ue_handler, 0, | 502 | if (request_irq(irq, sysio_ue_handler, 0, |
@@ -537,7 +537,7 @@ static void __init sysio_register_error_handlers(struct of_device *op) | |||
537 | static void __init sbus_iommu_init(struct of_device *op) | 537 | static void __init sbus_iommu_init(struct of_device *op) |
538 | { | 538 | { |
539 | const struct linux_prom64_registers *pr; | 539 | const struct linux_prom64_registers *pr; |
540 | struct device_node *dp = op->node; | 540 | struct device_node *dp = op->dev.of_node; |
541 | struct iommu *iommu; | 541 | struct iommu *iommu; |
542 | struct strbuf *strbuf; | 542 | struct strbuf *strbuf; |
543 | unsigned long regs, reg_base; | 543 | unsigned long regs, reg_base; |
@@ -589,7 +589,7 @@ static void __init sbus_iommu_init(struct of_device *op) | |||
589 | */ | 589 | */ |
590 | iommu->write_complete_reg = regs + 0x2000UL; | 590 | iommu->write_complete_reg = regs + 0x2000UL; |
591 | 591 | ||
592 | portid = of_getintprop_default(op->node, "portid", -1); | 592 | portid = of_getintprop_default(op->dev.of_node, "portid", -1); |
593 | printk(KERN_INFO "SYSIO: UPA portID %x, at %016lx\n", | 593 | printk(KERN_INFO "SYSIO: UPA portID %x, at %016lx\n", |
594 | portid, regs); | 594 | portid, regs); |
595 | 595 | ||
diff --git a/arch/sparc/kernel/time_32.c b/arch/sparc/kernel/time_32.c index 4453003032b5..e404b063be2c 100644 --- a/arch/sparc/kernel/time_32.c +++ b/arch/sparc/kernel/time_32.c | |||
@@ -144,7 +144,7 @@ static struct platform_device m48t59_rtc = { | |||
144 | 144 | ||
145 | static int __devinit clock_probe(struct of_device *op, const struct of_device_id *match) | 145 | static int __devinit clock_probe(struct of_device *op, const struct of_device_id *match) |
146 | { | 146 | { |
147 | struct device_node *dp = op->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); |
149 | 149 | ||
150 | if (!model) | 150 | if (!model) |
@@ -177,10 +177,11 @@ static struct of_device_id __initdata clock_match[] = { | |||
177 | }; | 177 | }; |
178 | 178 | ||
179 | static struct of_platform_driver clock_driver = { | 179 | static struct of_platform_driver clock_driver = { |
180 | .match_table = clock_match, | ||
181 | .probe = clock_probe, | 180 | .probe = clock_probe, |
182 | .driver = { | 181 | .driver = { |
183 | .name = "rtc", | 182 | .name = "rtc", |
183 | .owner = THIS_MODULE, | ||
184 | .of_match_table = clock_match, | ||
184 | }, | 185 | }, |
185 | }; | 186 | }; |
186 | 187 | ||
diff --git a/arch/sparc/kernel/time_64.c b/arch/sparc/kernel/time_64.c index c7bbe6cf7b85..21e9fcae0668 100644 --- a/arch/sparc/kernel/time_64.c +++ b/arch/sparc/kernel/time_64.c | |||
@@ -424,7 +424,7 @@ static int __devinit rtc_probe(struct of_device *op, const struct of_device_id * | |||
424 | struct resource *r; | 424 | struct resource *r; |
425 | 425 | ||
426 | printk(KERN_INFO "%s: RTC regs at 0x%llx\n", | 426 | printk(KERN_INFO "%s: RTC regs at 0x%llx\n", |
427 | op->node->full_name, op->resource[0].start); | 427 | op->dev.of_node->full_name, op->resource[0].start); |
428 | 428 | ||
429 | /* The CMOS RTC driver only accepts IORESOURCE_IO, so cons | 429 | /* The CMOS RTC driver only accepts IORESOURCE_IO, so cons |
430 | * up a fake resource so that the probe works for all cases. | 430 | * up a fake resource so that the probe works for all cases. |
@@ -463,10 +463,11 @@ static struct of_device_id __initdata rtc_match[] = { | |||
463 | }; | 463 | }; |
464 | 464 | ||
465 | static struct of_platform_driver rtc_driver = { | 465 | static struct of_platform_driver rtc_driver = { |
466 | .match_table = rtc_match, | ||
467 | .probe = rtc_probe, | 466 | .probe = rtc_probe, |
468 | .driver = { | 467 | .driver = { |
469 | .name = "rtc", | 468 | .name = "rtc", |
469 | .owner = THIS_MODULE, | ||
470 | .of_match_table = rtc_match, | ||
470 | }, | 471 | }, |
471 | }; | 472 | }; |
472 | 473 | ||
@@ -480,7 +481,7 @@ static int __devinit bq4802_probe(struct of_device *op, const struct of_device_i | |||
480 | { | 481 | { |
481 | 482 | ||
482 | printk(KERN_INFO "%s: BQ4802 regs at 0x%llx\n", | 483 | printk(KERN_INFO "%s: BQ4802 regs at 0x%llx\n", |
483 | op->node->full_name, op->resource[0].start); | 484 | op->dev.of_node->full_name, op->resource[0].start); |
484 | 485 | ||
485 | rtc_bq4802_device.resource = &op->resource[0]; | 486 | rtc_bq4802_device.resource = &op->resource[0]; |
486 | return platform_device_register(&rtc_bq4802_device); | 487 | return platform_device_register(&rtc_bq4802_device); |
@@ -495,10 +496,11 @@ static struct of_device_id __initdata bq4802_match[] = { | |||
495 | }; | 496 | }; |
496 | 497 | ||
497 | static struct of_platform_driver bq4802_driver = { | 498 | static struct of_platform_driver bq4802_driver = { |
498 | .match_table = bq4802_match, | ||
499 | .probe = bq4802_probe, | 499 | .probe = bq4802_probe, |
500 | .driver = { | 500 | .driver = { |
501 | .name = "bq4802", | 501 | .name = "bq4802", |
502 | .owner = THIS_MODULE, | ||
503 | .of_match_table = bq4802_match, | ||
502 | }, | 504 | }, |
503 | }; | 505 | }; |
504 | 506 | ||
@@ -534,7 +536,7 @@ static struct platform_device m48t59_rtc = { | |||
534 | 536 | ||
535 | static int __devinit mostek_probe(struct of_device *op, const struct of_device_id *match) | 537 | static int __devinit mostek_probe(struct of_device *op, const struct of_device_id *match) |
536 | { | 538 | { |
537 | struct device_node *dp = op->node; | 539 | struct device_node *dp = op->dev.of_node; |
538 | 540 | ||
539 | /* On an Enterprise system there can be multiple mostek clocks. | 541 | /* On an Enterprise system there can be multiple mostek clocks. |
540 | * We should only match the one that is on the central FHC bus. | 542 | * We should only match the one that is on the central FHC bus. |
@@ -558,10 +560,11 @@ static struct of_device_id __initdata mostek_match[] = { | |||
558 | }; | 560 | }; |
559 | 561 | ||
560 | static struct of_platform_driver mostek_driver = { | 562 | static struct of_platform_driver mostek_driver = { |
561 | .match_table = mostek_match, | ||
562 | .probe = mostek_probe, | 563 | .probe = mostek_probe, |
563 | .driver = { | 564 | .driver = { |
564 | .name = "mostek", | 565 | .name = "mostek", |
566 | .owner = THIS_MODULE, | ||
567 | .of_match_table = mostek_match, | ||
565 | }, | 568 | }, |
566 | }; | 569 | }; |
567 | 570 | ||