diff options
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/include/asm/device.h | 15 | ||||
-rw-r--r-- | arch/powerpc/include/asm/of_device.h | 1 | ||||
-rw-r--r-- | arch/powerpc/kernel/of_device.c | 4 | ||||
-rw-r--r-- | arch/powerpc/kernel/pci-common.c | 1 | ||||
-rw-r--r-- | arch/powerpc/kernel/vio.c | 17 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/iommu.c | 5 | ||||
-rw-r--r-- | arch/powerpc/platforms/pasemi/setup.c | 4 | ||||
-rw-r--r-- | arch/powerpc/platforms/ps3/system-bus.c | 1 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/iommu.c | 2 |
9 files changed, 14 insertions, 36 deletions
diff --git a/arch/powerpc/include/asm/device.h b/arch/powerpc/include/asm/device.h index 6d94d27ed850..f23f8d8bd68d 100644 --- a/arch/powerpc/include/asm/device.h +++ b/arch/powerpc/include/asm/device.h | |||
@@ -10,9 +10,6 @@ struct dma_map_ops; | |||
10 | struct device_node; | 10 | struct device_node; |
11 | 11 | ||
12 | struct dev_archdata { | 12 | struct dev_archdata { |
13 | /* Optional pointer to an OF device node */ | ||
14 | struct device_node *of_node; | ||
15 | |||
16 | /* DMA operations on that device */ | 13 | /* DMA operations on that device */ |
17 | struct dma_map_ops *dma_ops; | 14 | struct dma_map_ops *dma_ops; |
18 | 15 | ||
@@ -30,18 +27,6 @@ struct dev_archdata { | |||
30 | #endif | 27 | #endif |
31 | }; | 28 | }; |
32 | 29 | ||
33 | static inline void dev_archdata_set_node(struct dev_archdata *ad, | ||
34 | struct device_node *np) | ||
35 | { | ||
36 | ad->of_node = np; | ||
37 | } | ||
38 | |||
39 | static inline struct device_node * | ||
40 | dev_archdata_get_node(const struct dev_archdata *ad) | ||
41 | { | ||
42 | return ad->of_node; | ||
43 | } | ||
44 | |||
45 | struct pdev_archdata { | 30 | struct pdev_archdata { |
46 | }; | 31 | }; |
47 | 32 | ||
diff --git a/arch/powerpc/include/asm/of_device.h b/arch/powerpc/include/asm/of_device.h index a64debf177dc..8b26f96b9f9e 100644 --- a/arch/powerpc/include/asm/of_device.h +++ b/arch/powerpc/include/asm/of_device.h | |||
@@ -12,7 +12,6 @@ | |||
12 | */ | 12 | */ |
13 | struct of_device | 13 | struct of_device |
14 | { | 14 | { |
15 | struct device_node *node; /* to be obsoleted */ | ||
16 | u64 dma_mask; /* DMA mask */ | 15 | u64 dma_mask; /* DMA mask */ |
17 | struct device dev; /* Generic device interface */ | 16 | struct device dev; /* Generic device interface */ |
18 | }; | 17 | }; |
diff --git a/arch/powerpc/kernel/of_device.c b/arch/powerpc/kernel/of_device.c index 285c8490c547..20b3474b6f6b 100644 --- a/arch/powerpc/kernel/of_device.c +++ b/arch/powerpc/kernel/of_device.c | |||
@@ -69,12 +69,10 @@ struct of_device *of_device_alloc(struct device_node *np, | |||
69 | if (!dev) | 69 | if (!dev) |
70 | return NULL; | 70 | return NULL; |
71 | 71 | ||
72 | dev->node = of_node_get(np); | 72 | dev->dev.of_node = of_node_get(np); |
73 | dev->dev.dma_mask = &dev->dma_mask; | 73 | dev->dev.dma_mask = &dev->dma_mask; |
74 | dev->dev.parent = parent; | 74 | dev->dev.parent = parent; |
75 | dev->dev.release = of_release_dev; | 75 | dev->dev.release = of_release_dev; |
76 | dev->dev.archdata.of_node = np; | ||
77 | dev->dev.of_node = np; | ||
78 | 76 | ||
79 | if (bus_id) | 77 | if (bus_id) |
80 | dev_set_name(&dev->dev, "%s", bus_id); | 78 | dev_set_name(&dev->dev, "%s", bus_id); |
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index 88da282047c3..6646005dffb1 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c | |||
@@ -1098,7 +1098,6 @@ void __devinit pcibios_setup_bus_devices(struct pci_bus *bus) | |||
1098 | continue; | 1098 | continue; |
1099 | 1099 | ||
1100 | /* Setup OF node pointer in the device */ | 1100 | /* Setup OF node pointer in the device */ |
1101 | sd->of_node = pci_device_to_OF_node(dev); | ||
1102 | dev->dev.of_node = pci_device_to_OF_node(dev); | 1101 | dev->dev.of_node = pci_device_to_OF_node(dev); |
1103 | 1102 | ||
1104 | /* Fixup NUMA node as it may not be setup yet by the generic | 1103 | /* Fixup NUMA node as it may not be setup yet by the generic |
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c index d6708da114ee..4cdd0f6df8bf 100644 --- a/arch/powerpc/kernel/vio.c +++ b/arch/powerpc/kernel/vio.c | |||
@@ -705,7 +705,7 @@ static int vio_cmo_bus_probe(struct vio_dev *viodev) | |||
705 | * Check to see that device has a DMA window and configure | 705 | * Check to see that device has a DMA window and configure |
706 | * entitlement for the device. | 706 | * entitlement for the device. |
707 | */ | 707 | */ |
708 | if (of_get_property(viodev->dev.archdata.of_node, | 708 | if (of_get_property(viodev->dev.of_node, |
709 | "ibm,my-dma-window", NULL)) { | 709 | "ibm,my-dma-window", NULL)) { |
710 | /* Check that the driver is CMO enabled and get desired DMA */ | 710 | /* Check that the driver is CMO enabled and get desired DMA */ |
711 | if (!viodrv->get_desired_dma) { | 711 | if (!viodrv->get_desired_dma) { |
@@ -1049,7 +1049,7 @@ static struct iommu_table *vio_build_iommu_table(struct vio_dev *dev) | |||
1049 | if (firmware_has_feature(FW_FEATURE_ISERIES)) | 1049 | if (firmware_has_feature(FW_FEATURE_ISERIES)) |
1050 | return vio_build_iommu_table_iseries(dev); | 1050 | return vio_build_iommu_table_iseries(dev); |
1051 | 1051 | ||
1052 | dma_window = of_get_property(dev->dev.archdata.of_node, | 1052 | dma_window = of_get_property(dev->dev.of_node, |
1053 | "ibm,my-dma-window", NULL); | 1053 | "ibm,my-dma-window", NULL); |
1054 | if (!dma_window) | 1054 | if (!dma_window) |
1055 | return NULL; | 1055 | return NULL; |
@@ -1058,7 +1058,7 @@ static struct iommu_table *vio_build_iommu_table(struct vio_dev *dev) | |||
1058 | if (tbl == NULL) | 1058 | if (tbl == NULL) |
1059 | return NULL; | 1059 | return NULL; |
1060 | 1060 | ||
1061 | of_parse_dma_window(dev->dev.archdata.of_node, dma_window, | 1061 | of_parse_dma_window(dev->dev.of_node, dma_window, |
1062 | &tbl->it_index, &offset, &size); | 1062 | &tbl->it_index, &offset, &size); |
1063 | 1063 | ||
1064 | /* TCE table size - measured in tce entries */ | 1064 | /* TCE table size - measured in tce entries */ |
@@ -1086,7 +1086,7 @@ static const struct vio_device_id *vio_match_device( | |||
1086 | { | 1086 | { |
1087 | while (ids->type[0] != '\0') { | 1087 | while (ids->type[0] != '\0') { |
1088 | if ((strncmp(dev->type, ids->type, strlen(ids->type)) == 0) && | 1088 | if ((strncmp(dev->type, ids->type, strlen(ids->type)) == 0) && |
1089 | of_device_is_compatible(dev->dev.archdata.of_node, | 1089 | of_device_is_compatible(dev->dev.of_node, |
1090 | ids->compat)) | 1090 | ids->compat)) |
1091 | return ids; | 1091 | return ids; |
1092 | ids++; | 1092 | ids++; |
@@ -1179,7 +1179,7 @@ EXPORT_SYMBOL(vio_unregister_driver); | |||
1179 | static void __devinit vio_dev_release(struct device *dev) | 1179 | static void __devinit vio_dev_release(struct device *dev) |
1180 | { | 1180 | { |
1181 | /* XXX should free TCE table */ | 1181 | /* XXX should free TCE table */ |
1182 | of_node_put(dev->archdata.of_node); | 1182 | of_node_put(dev->of_node); |
1183 | kfree(to_vio_dev(dev)); | 1183 | kfree(to_vio_dev(dev)); |
1184 | } | 1184 | } |
1185 | 1185 | ||
@@ -1231,7 +1231,6 @@ struct vio_dev *vio_register_device_node(struct device_node *of_node) | |||
1231 | viodev->unit_address = *unit_address; | 1231 | viodev->unit_address = *unit_address; |
1232 | } | 1232 | } |
1233 | viodev->dev.of_node = of_node_get(of_node); | 1233 | viodev->dev.of_node = of_node_get(of_node); |
1234 | viodev->dev.archdata.of_node = viodev->dev.of_node; | ||
1235 | 1234 | ||
1236 | if (firmware_has_feature(FW_FEATURE_CMO)) | 1235 | if (firmware_has_feature(FW_FEATURE_CMO)) |
1237 | vio_cmo_set_dma_ops(viodev); | 1236 | vio_cmo_set_dma_ops(viodev); |
@@ -1316,7 +1315,7 @@ static ssize_t name_show(struct device *dev, | |||
1316 | static ssize_t devspec_show(struct device *dev, | 1315 | static ssize_t devspec_show(struct device *dev, |
1317 | struct device_attribute *attr, char *buf) | 1316 | struct device_attribute *attr, char *buf) |
1318 | { | 1317 | { |
1319 | struct device_node *of_node = dev->archdata.of_node; | 1318 | struct device_node *of_node = dev->of_node; |
1320 | 1319 | ||
1321 | return sprintf(buf, "%s\n", of_node ? of_node->full_name : "none"); | 1320 | return sprintf(buf, "%s\n", of_node ? of_node->full_name : "none"); |
1322 | } | 1321 | } |
@@ -1348,7 +1347,7 @@ static int vio_hotplug(struct device *dev, struct kobj_uevent_env *env) | |||
1348 | struct device_node *dn; | 1347 | struct device_node *dn; |
1349 | const char *cp; | 1348 | const char *cp; |
1350 | 1349 | ||
1351 | dn = dev->archdata.of_node; | 1350 | dn = dev->of_node; |
1352 | if (!dn) | 1351 | if (!dn) |
1353 | return -ENODEV; | 1352 | return -ENODEV; |
1354 | cp = of_get_property(dn, "compatible", NULL); | 1353 | cp = of_get_property(dn, "compatible", NULL); |
@@ -1379,7 +1378,7 @@ static struct bus_type vio_bus_type = { | |||
1379 | */ | 1378 | */ |
1380 | const void *vio_get_attribute(struct vio_dev *vdev, char *which, int *length) | 1379 | const void *vio_get_attribute(struct vio_dev *vdev, char *which, int *length) |
1381 | { | 1380 | { |
1382 | return of_get_property(vdev->dev.archdata.of_node, which, length); | 1381 | return of_get_property(vdev->dev.of_node, which, length); |
1383 | } | 1382 | } |
1384 | EXPORT_SYMBOL(vio_get_attribute); | 1383 | EXPORT_SYMBOL(vio_get_attribute); |
1385 | 1384 | ||
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c index e3ec4976fae7..22667a09d40e 100644 --- a/arch/powerpc/platforms/cell/iommu.c +++ b/arch/powerpc/platforms/cell/iommu.c | |||
@@ -545,7 +545,6 @@ static struct iommu_table *cell_get_iommu_table(struct device *dev) | |||
545 | { | 545 | { |
546 | struct iommu_window *window; | 546 | struct iommu_window *window; |
547 | struct cbe_iommu *iommu; | 547 | struct cbe_iommu *iommu; |
548 | struct dev_archdata *archdata = &dev->archdata; | ||
549 | 548 | ||
550 | /* Current implementation uses the first window available in that | 549 | /* Current implementation uses the first window available in that |
551 | * node's iommu. We -might- do something smarter later though it may | 550 | * node's iommu. We -might- do something smarter later though it may |
@@ -554,7 +553,7 @@ static struct iommu_table *cell_get_iommu_table(struct device *dev) | |||
554 | iommu = cell_iommu_for_node(dev_to_node(dev)); | 553 | iommu = cell_iommu_for_node(dev_to_node(dev)); |
555 | if (iommu == NULL || list_empty(&iommu->windows)) { | 554 | if (iommu == NULL || list_empty(&iommu->windows)) { |
556 | printk(KERN_ERR "iommu: missing iommu for %s (node %d)\n", | 555 | printk(KERN_ERR "iommu: missing iommu for %s (node %d)\n", |
557 | archdata->of_node ? archdata->of_node->full_name : "?", | 556 | dev->of_node ? dev->of_node->full_name : "?", |
558 | dev_to_node(dev)); | 557 | dev_to_node(dev)); |
559 | return NULL; | 558 | return NULL; |
560 | } | 559 | } |
@@ -897,7 +896,7 @@ static u64 cell_iommu_get_fixed_address(struct device *dev) | |||
897 | const u32 *ranges = NULL; | 896 | const u32 *ranges = NULL; |
898 | int i, len, best, naddr, nsize, pna, range_size; | 897 | int i, len, best, naddr, nsize, pna, range_size; |
899 | 898 | ||
900 | np = of_node_get(dev->archdata.of_node); | 899 | np = of_node_get(dev->of_node); |
901 | while (1) { | 900 | while (1) { |
902 | naddr = of_n_addr_cells(np); | 901 | naddr = of_n_addr_cells(np); |
903 | nsize = of_n_size_cells(np); | 902 | nsize = of_n_size_cells(np); |
diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c index ac6fdd973291..f372ec1691a3 100644 --- a/arch/powerpc/platforms/pasemi/setup.c +++ b/arch/powerpc/platforms/pasemi/setup.c | |||
@@ -360,10 +360,10 @@ static int pcmcia_notify(struct notifier_block *nb, unsigned long action, | |||
360 | /* We know electra_cf devices will always have of_node set, since | 360 | /* We know electra_cf devices will always have of_node set, since |
361 | * electra_cf is an of_platform driver. | 361 | * electra_cf is an of_platform driver. |
362 | */ | 362 | */ |
363 | if (!parent->archdata.of_node) | 363 | if (!parent->of_node) |
364 | return 0; | 364 | return 0; |
365 | 365 | ||
366 | if (!of_device_is_compatible(parent->archdata.of_node, "electra-cf")) | 366 | if (!of_device_is_compatible(parent->of_node, "electra-cf")) |
367 | return 0; | 367 | return 0; |
368 | 368 | ||
369 | /* We use the direct ops for localbus */ | 369 | /* We use the direct ops for localbus */ |
diff --git a/arch/powerpc/platforms/ps3/system-bus.c b/arch/powerpc/platforms/ps3/system-bus.c index e546c86a539b..23083c397528 100644 --- a/arch/powerpc/platforms/ps3/system-bus.c +++ b/arch/powerpc/platforms/ps3/system-bus.c | |||
@@ -767,7 +767,6 @@ int ps3_system_bus_device_register(struct ps3_system_bus_device *dev) | |||
767 | }; | 767 | }; |
768 | 768 | ||
769 | dev->core.of_node = NULL; | 769 | dev->core.of_node = NULL; |
770 | dev->core.archdata.of_node = NULL; | ||
771 | set_dev_node(&dev->core, 0); | 770 | set_dev_node(&dev->core, 0); |
772 | 771 | ||
773 | pr_debug("%s:%d add %s\n", __func__, __LINE__, dev_name(&dev->core)); | 772 | pr_debug("%s:%d add %s\n", __func__, __LINE__, dev_name(&dev->core)); |
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c index 1a0000a4b6d6..d26182d42cbf 100644 --- a/arch/powerpc/platforms/pseries/iommu.c +++ b/arch/powerpc/platforms/pseries/iommu.c | |||
@@ -468,7 +468,7 @@ static void pci_dma_dev_setup_pSeries(struct pci_dev *dev) | |||
468 | 468 | ||
469 | pr_debug("pci_dma_dev_setup_pSeries: %s\n", pci_name(dev)); | 469 | pr_debug("pci_dma_dev_setup_pSeries: %s\n", pci_name(dev)); |
470 | 470 | ||
471 | dn = dev->dev.archdata.of_node; | 471 | dn = dev->dev.of_node; |
472 | 472 | ||
473 | /* If we're the direct child of a root bus, then we need to allocate | 473 | /* If we're the direct child of a root bus, then we need to allocate |
474 | * an iommu table ourselves. The bus setup code should have setup | 474 | * an iommu table ourselves. The bus setup code should have setup |