diff options
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r-- | arch/powerpc/kernel/dma-swiotlb.c | 4 | ||||
-rw-r--r-- | arch/powerpc/kernel/dma.c | 12 | ||||
-rw-r--r-- | arch/powerpc/kernel/ibmebus.c | 6 | ||||
-rw-r--r-- | arch/powerpc/kernel/of_device.c | 13 | ||||
-rw-r--r-- | arch/powerpc/kernel/of_platform.c | 21 | ||||
-rw-r--r-- | arch/powerpc/kernel/pci-common.c | 4 | ||||
-rw-r--r-- | arch/powerpc/kernel/vio.c | 20 |
7 files changed, 40 insertions, 40 deletions
diff --git a/arch/powerpc/kernel/dma-swiotlb.c b/arch/powerpc/kernel/dma-swiotlb.c index 4ff4da2c238b..e7fe218b8697 100644 --- a/arch/powerpc/kernel/dma-swiotlb.c +++ b/arch/powerpc/kernel/dma-swiotlb.c | |||
@@ -39,8 +39,8 @@ struct dma_map_ops swiotlb_dma_ops = { | |||
39 | .dma_supported = swiotlb_dma_supported, | 39 | .dma_supported = swiotlb_dma_supported, |
40 | .map_page = swiotlb_map_page, | 40 | .map_page = swiotlb_map_page, |
41 | .unmap_page = swiotlb_unmap_page, | 41 | .unmap_page = swiotlb_unmap_page, |
42 | .sync_single_range_for_cpu = swiotlb_sync_single_range_for_cpu, | 42 | .sync_single_for_cpu = swiotlb_sync_single_for_cpu, |
43 | .sync_single_range_for_device = swiotlb_sync_single_range_for_device, | 43 | .sync_single_for_device = swiotlb_sync_single_for_device, |
44 | .sync_sg_for_cpu = swiotlb_sync_sg_for_cpu, | 44 | .sync_sg_for_cpu = swiotlb_sync_sg_for_cpu, |
45 | .sync_sg_for_device = swiotlb_sync_sg_for_device, | 45 | .sync_sg_for_device = swiotlb_sync_sg_for_device, |
46 | .mapping_error = swiotlb_dma_mapping_error, | 46 | .mapping_error = swiotlb_dma_mapping_error, |
diff --git a/arch/powerpc/kernel/dma.c b/arch/powerpc/kernel/dma.c index 6c1df5757cd6..8d1de6f31d5a 100644 --- a/arch/powerpc/kernel/dma.c +++ b/arch/powerpc/kernel/dma.c | |||
@@ -127,11 +127,11 @@ static inline void dma_direct_sync_sg(struct device *dev, | |||
127 | __dma_sync_page(sg_page(sg), sg->offset, sg->length, direction); | 127 | __dma_sync_page(sg_page(sg), sg->offset, sg->length, direction); |
128 | } | 128 | } |
129 | 129 | ||
130 | static inline void dma_direct_sync_single_range(struct device *dev, | 130 | static inline void dma_direct_sync_single(struct device *dev, |
131 | dma_addr_t dma_handle, unsigned long offset, size_t size, | 131 | dma_addr_t dma_handle, size_t size, |
132 | enum dma_data_direction direction) | 132 | enum dma_data_direction direction) |
133 | { | 133 | { |
134 | __dma_sync(bus_to_virt(dma_handle+offset), size, direction); | 134 | __dma_sync(bus_to_virt(dma_handle), size, direction); |
135 | } | 135 | } |
136 | #endif | 136 | #endif |
137 | 137 | ||
@@ -144,8 +144,8 @@ struct dma_map_ops dma_direct_ops = { | |||
144 | .map_page = dma_direct_map_page, | 144 | .map_page = dma_direct_map_page, |
145 | .unmap_page = dma_direct_unmap_page, | 145 | .unmap_page = dma_direct_unmap_page, |
146 | #ifdef CONFIG_NOT_COHERENT_CACHE | 146 | #ifdef CONFIG_NOT_COHERENT_CACHE |
147 | .sync_single_range_for_cpu = dma_direct_sync_single_range, | 147 | .sync_single_for_cpu = dma_direct_sync_single, |
148 | .sync_single_range_for_device = dma_direct_sync_single_range, | 148 | .sync_single_for_device = dma_direct_sync_single, |
149 | .sync_sg_for_cpu = dma_direct_sync_sg, | 149 | .sync_sg_for_cpu = dma_direct_sync_sg, |
150 | .sync_sg_for_device = dma_direct_sync_sg, | 150 | .sync_sg_for_device = dma_direct_sync_sg, |
151 | #endif | 151 | #endif |
diff --git a/arch/powerpc/kernel/ibmebus.c b/arch/powerpc/kernel/ibmebus.c index 71cf280da184..21266abfbda6 100644 --- a/arch/powerpc/kernel/ibmebus.c +++ b/arch/powerpc/kernel/ibmebus.c | |||
@@ -140,14 +140,14 @@ static struct dma_map_ops ibmebus_dma_ops = { | |||
140 | 140 | ||
141 | static int ibmebus_match_path(struct device *dev, void *data) | 141 | static int ibmebus_match_path(struct device *dev, void *data) |
142 | { | 142 | { |
143 | struct device_node *dn = to_of_device(dev)->node; | 143 | struct device_node *dn = to_of_device(dev)->dev.of_node; |
144 | return (dn->full_name && | 144 | return (dn->full_name && |
145 | (strcasecmp((char *)data, dn->full_name) == 0)); | 145 | (strcasecmp((char *)data, dn->full_name) == 0)); |
146 | } | 146 | } |
147 | 147 | ||
148 | static int ibmebus_match_node(struct device *dev, void *data) | 148 | static int ibmebus_match_node(struct device *dev, void *data) |
149 | { | 149 | { |
150 | return to_of_device(dev)->node == data; | 150 | return to_of_device(dev)->dev.of_node == data; |
151 | } | 151 | } |
152 | 152 | ||
153 | static int ibmebus_create_device(struct device_node *dn) | 153 | static int ibmebus_create_device(struct device_node *dn) |
@@ -202,7 +202,7 @@ static int ibmebus_create_devices(const struct of_device_id *matches) | |||
202 | int ibmebus_register_driver(struct of_platform_driver *drv) | 202 | int ibmebus_register_driver(struct of_platform_driver *drv) |
203 | { | 203 | { |
204 | /* If the driver uses devices that ibmebus doesn't know, add them */ | 204 | /* If the driver uses devices that ibmebus doesn't know, add them */ |
205 | ibmebus_create_devices(drv->match_table); | 205 | ibmebus_create_devices(drv->driver.of_match_table); |
206 | 206 | ||
207 | return of_register_driver(drv, &ibmebus_bus_type); | 207 | return of_register_driver(drv, &ibmebus_bus_type); |
208 | } | 208 | } |
diff --git a/arch/powerpc/kernel/of_device.c b/arch/powerpc/kernel/of_device.c index a359cb08e900..df78e0236a02 100644 --- a/arch/powerpc/kernel/of_device.c +++ b/arch/powerpc/kernel/of_device.c | |||
@@ -13,7 +13,7 @@ | |||
13 | static void of_device_make_bus_id(struct of_device *dev) | 13 | static void of_device_make_bus_id(struct of_device *dev) |
14 | { | 14 | { |
15 | static atomic_t bus_no_reg_magic; | 15 | static atomic_t bus_no_reg_magic; |
16 | struct device_node *node = dev->node; | 16 | struct device_node *node = dev->dev.of_node; |
17 | const u32 *reg; | 17 | const u32 *reg; |
18 | u64 addr; | 18 | u64 addr; |
19 | int magic; | 19 | int magic; |
@@ -69,11 +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->archdata.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 | 76 | ||
78 | if (bus_id) | 77 | if (bus_id) |
79 | dev_set_name(&dev->dev, "%s", bus_id); | 78 | dev_set_name(&dev->dev, "%s", bus_id); |
@@ -95,17 +94,17 @@ int of_device_uevent(struct device *dev, struct kobj_uevent_env *env) | |||
95 | 94 | ||
96 | ofdev = to_of_device(dev); | 95 | ofdev = to_of_device(dev); |
97 | 96 | ||
98 | if (add_uevent_var(env, "OF_NAME=%s", ofdev->node->name)) | 97 | if (add_uevent_var(env, "OF_NAME=%s", ofdev->dev.of_node->name)) |
99 | return -ENOMEM; | 98 | return -ENOMEM; |
100 | 99 | ||
101 | if (add_uevent_var(env, "OF_TYPE=%s", ofdev->node->type)) | 100 | if (add_uevent_var(env, "OF_TYPE=%s", ofdev->dev.of_node->type)) |
102 | return -ENOMEM; | 101 | return -ENOMEM; |
103 | 102 | ||
104 | /* Since the compatible field can contain pretty much anything | 103 | /* Since the compatible field can contain pretty much anything |
105 | * it's not really legal to split it out with commas. We split it | 104 | * it's not really legal to split it out with commas. We split it |
106 | * up using a number of environment variables instead. */ | 105 | * up using a number of environment variables instead. */ |
107 | 106 | ||
108 | compat = of_get_property(ofdev->node, "compatible", &cplen); | 107 | compat = of_get_property(ofdev->dev.of_node, "compatible", &cplen); |
109 | while (compat && *compat && cplen > 0) { | 108 | while (compat && *compat && cplen > 0) { |
110 | if (add_uevent_var(env, "OF_COMPATIBLE_%d=%s", seen, compat)) | 109 | if (add_uevent_var(env, "OF_COMPATIBLE_%d=%s", seen, compat)) |
111 | return -ENOMEM; | 110 | return -ENOMEM; |
diff --git a/arch/powerpc/kernel/of_platform.c b/arch/powerpc/kernel/of_platform.c index 6c1dfc3ff8bc..487a98851ba6 100644 --- a/arch/powerpc/kernel/of_platform.c +++ b/arch/powerpc/kernel/of_platform.c | |||
@@ -74,7 +74,7 @@ struct of_device* of_platform_device_create(struct device_node *np, | |||
74 | if (!dev) | 74 | if (!dev) |
75 | return NULL; | 75 | return NULL; |
76 | 76 | ||
77 | dev->dma_mask = 0xffffffffUL; | 77 | dev->archdata.dma_mask = 0xffffffffUL; |
78 | dev->dev.coherent_dma_mask = DMA_BIT_MASK(32); | 78 | dev->dev.coherent_dma_mask = DMA_BIT_MASK(32); |
79 | 79 | ||
80 | dev->dev.bus = &of_platform_bus_type; | 80 | dev->dev.bus = &of_platform_bus_type; |
@@ -195,7 +195,7 @@ EXPORT_SYMBOL(of_platform_bus_probe); | |||
195 | 195 | ||
196 | static int of_dev_node_match(struct device *dev, void *data) | 196 | static int of_dev_node_match(struct device *dev, void *data) |
197 | { | 197 | { |
198 | return to_of_device(dev)->node == data; | 198 | return to_of_device(dev)->dev.of_node == data; |
199 | } | 199 | } |
200 | 200 | ||
201 | struct of_device *of_find_device_by_node(struct device_node *np) | 201 | struct of_device *of_find_device_by_node(struct device_node *np) |
@@ -213,7 +213,7 @@ EXPORT_SYMBOL(of_find_device_by_node); | |||
213 | static int of_dev_phandle_match(struct device *dev, void *data) | 213 | static int of_dev_phandle_match(struct device *dev, void *data) |
214 | { | 214 | { |
215 | phandle *ph = data; | 215 | phandle *ph = data; |
216 | return to_of_device(dev)->node->phandle == *ph; | 216 | return to_of_device(dev)->dev.of_node->phandle == *ph; |
217 | } | 217 | } |
218 | 218 | ||
219 | struct of_device *of_find_device_by_phandle(phandle ph) | 219 | struct of_device *of_find_device_by_phandle(phandle ph) |
@@ -246,10 +246,10 @@ static int __devinit of_pci_phb_probe(struct of_device *dev, | |||
246 | if (ppc_md.pci_setup_phb == NULL) | 246 | if (ppc_md.pci_setup_phb == NULL) |
247 | return -ENODEV; | 247 | return -ENODEV; |
248 | 248 | ||
249 | printk(KERN_INFO "Setting up PCI bus %s\n", dev->node->full_name); | 249 | pr_info("Setting up PCI bus %s\n", dev->dev.of_node->full_name); |
250 | 250 | ||
251 | /* Alloc and setup PHB data structure */ | 251 | /* Alloc and setup PHB data structure */ |
252 | phb = pcibios_alloc_controller(dev->node); | 252 | phb = pcibios_alloc_controller(dev->dev.of_node); |
253 | if (!phb) | 253 | if (!phb) |
254 | return -ENODEV; | 254 | return -ENODEV; |
255 | 255 | ||
@@ -263,19 +263,19 @@ static int __devinit of_pci_phb_probe(struct of_device *dev, | |||
263 | } | 263 | } |
264 | 264 | ||
265 | /* Process "ranges" property */ | 265 | /* Process "ranges" property */ |
266 | pci_process_bridge_OF_ranges(phb, dev->node, 0); | 266 | pci_process_bridge_OF_ranges(phb, dev->dev.of_node, 0); |
267 | 267 | ||
268 | /* Init pci_dn data structures */ | 268 | /* Init pci_dn data structures */ |
269 | pci_devs_phb_init_dynamic(phb); | 269 | pci_devs_phb_init_dynamic(phb); |
270 | 270 | ||
271 | /* Register devices with EEH */ | 271 | /* Register devices with EEH */ |
272 | #ifdef CONFIG_EEH | 272 | #ifdef CONFIG_EEH |
273 | if (dev->node->child) | 273 | if (dev->dev.of_node->child) |
274 | eeh_add_device_tree_early(dev->node); | 274 | eeh_add_device_tree_early(dev->dev.of_node); |
275 | #endif /* CONFIG_EEH */ | 275 | #endif /* CONFIG_EEH */ |
276 | 276 | ||
277 | /* Scan the bus */ | 277 | /* Scan the bus */ |
278 | pcibios_scan_phb(phb, dev->node); | 278 | pcibios_scan_phb(phb, dev->dev.of_node); |
279 | if (phb->bus == NULL) | 279 | if (phb->bus == NULL) |
280 | return -ENXIO; | 280 | return -ENXIO; |
281 | 281 | ||
@@ -306,10 +306,11 @@ static struct of_device_id of_pci_phb_ids[] = { | |||
306 | }; | 306 | }; |
307 | 307 | ||
308 | static struct of_platform_driver of_pci_phb_driver = { | 308 | static struct of_platform_driver of_pci_phb_driver = { |
309 | .match_table = of_pci_phb_ids, | ||
310 | .probe = of_pci_phb_probe, | 309 | .probe = of_pci_phb_probe, |
311 | .driver = { | 310 | .driver = { |
312 | .name = "of-pci", | 311 | .name = "of-pci", |
312 | .owner = THIS_MODULE, | ||
313 | .of_match_table = of_pci_phb_ids, | ||
313 | }, | 314 | }, |
314 | }; | 315 | }; |
315 | 316 | ||
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index 0c0567e58409..6646005dffb1 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c | |||
@@ -1097,8 +1097,8 @@ void __devinit pcibios_setup_bus_devices(struct pci_bus *bus) | |||
1097 | if (dev->is_added) | 1097 | if (dev->is_added) |
1098 | continue; | 1098 | continue; |
1099 | 1099 | ||
1100 | /* Setup OF node pointer in archdata */ | 1100 | /* Setup OF node pointer in the device */ |
1101 | sd->of_node = pci_device_to_OF_node(dev); | 1101 | dev->dev.of_node = pci_device_to_OF_node(dev); |
1102 | 1102 | ||
1103 | /* 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 |
1104 | * code and is needed by the DMA init | 1104 | * code and is needed by the DMA init |
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c index 9ce7b62dc3a4..00b9436f7652 100644 --- a/arch/powerpc/kernel/vio.c +++ b/arch/powerpc/kernel/vio.c | |||
@@ -707,7 +707,7 @@ static int vio_cmo_bus_probe(struct vio_dev *viodev) | |||
707 | * Check to see that device has a DMA window and configure | 707 | * Check to see that device has a DMA window and configure |
708 | * entitlement for the device. | 708 | * entitlement for the device. |
709 | */ | 709 | */ |
710 | if (of_get_property(viodev->dev.archdata.of_node, | 710 | if (of_get_property(viodev->dev.of_node, |
711 | "ibm,my-dma-window", NULL)) { | 711 | "ibm,my-dma-window", NULL)) { |
712 | /* Check that the driver is CMO enabled and get desired DMA */ | 712 | /* Check that the driver is CMO enabled and get desired DMA */ |
713 | if (!viodrv->get_desired_dma) { | 713 | if (!viodrv->get_desired_dma) { |
@@ -1054,7 +1054,7 @@ static struct iommu_table *vio_build_iommu_table(struct vio_dev *dev) | |||
1054 | if (firmware_has_feature(FW_FEATURE_ISERIES)) | 1054 | if (firmware_has_feature(FW_FEATURE_ISERIES)) |
1055 | return vio_build_iommu_table_iseries(dev); | 1055 | return vio_build_iommu_table_iseries(dev); |
1056 | 1056 | ||
1057 | dma_window = of_get_property(dev->dev.archdata.of_node, | 1057 | dma_window = of_get_property(dev->dev.of_node, |
1058 | "ibm,my-dma-window", NULL); | 1058 | "ibm,my-dma-window", NULL); |
1059 | if (!dma_window) | 1059 | if (!dma_window) |
1060 | return NULL; | 1060 | return NULL; |
@@ -1063,7 +1063,7 @@ static struct iommu_table *vio_build_iommu_table(struct vio_dev *dev) | |||
1063 | if (tbl == NULL) | 1063 | if (tbl == NULL) |
1064 | return NULL; | 1064 | return NULL; |
1065 | 1065 | ||
1066 | of_parse_dma_window(dev->dev.archdata.of_node, dma_window, | 1066 | of_parse_dma_window(dev->dev.of_node, dma_window, |
1067 | &tbl->it_index, &offset, &size); | 1067 | &tbl->it_index, &offset, &size); |
1068 | 1068 | ||
1069 | /* TCE table size - measured in tce entries */ | 1069 | /* TCE table size - measured in tce entries */ |
@@ -1091,7 +1091,7 @@ static const struct vio_device_id *vio_match_device( | |||
1091 | { | 1091 | { |
1092 | while (ids->type[0] != '\0') { | 1092 | while (ids->type[0] != '\0') { |
1093 | if ((strncmp(dev->type, ids->type, strlen(ids->type)) == 0) && | 1093 | if ((strncmp(dev->type, ids->type, strlen(ids->type)) == 0) && |
1094 | of_device_is_compatible(dev->dev.archdata.of_node, | 1094 | of_device_is_compatible(dev->dev.of_node, |
1095 | ids->compat)) | 1095 | ids->compat)) |
1096 | return ids; | 1096 | return ids; |
1097 | ids++; | 1097 | ids++; |
@@ -1184,7 +1184,7 @@ EXPORT_SYMBOL(vio_unregister_driver); | |||
1184 | static void __devinit vio_dev_release(struct device *dev) | 1184 | static void __devinit vio_dev_release(struct device *dev) |
1185 | { | 1185 | { |
1186 | /* XXX should free TCE table */ | 1186 | /* XXX should free TCE table */ |
1187 | of_node_put(dev->archdata.of_node); | 1187 | of_node_put(dev->of_node); |
1188 | kfree(to_vio_dev(dev)); | 1188 | kfree(to_vio_dev(dev)); |
1189 | } | 1189 | } |
1190 | 1190 | ||
@@ -1235,7 +1235,7 @@ struct vio_dev *vio_register_device_node(struct device_node *of_node) | |||
1235 | if (unit_address != NULL) | 1235 | if (unit_address != NULL) |
1236 | viodev->unit_address = *unit_address; | 1236 | viodev->unit_address = *unit_address; |
1237 | } | 1237 | } |
1238 | viodev->dev.archdata.of_node = of_node_get(of_node); | 1238 | viodev->dev.of_node = of_node_get(of_node); |
1239 | 1239 | ||
1240 | if (firmware_has_feature(FW_FEATURE_CMO)) | 1240 | if (firmware_has_feature(FW_FEATURE_CMO)) |
1241 | vio_cmo_set_dma_ops(viodev); | 1241 | vio_cmo_set_dma_ops(viodev); |
@@ -1320,7 +1320,7 @@ static ssize_t name_show(struct device *dev, | |||
1320 | static ssize_t devspec_show(struct device *dev, | 1320 | static ssize_t devspec_show(struct device *dev, |
1321 | struct device_attribute *attr, char *buf) | 1321 | struct device_attribute *attr, char *buf) |
1322 | { | 1322 | { |
1323 | struct device_node *of_node = dev->archdata.of_node; | 1323 | struct device_node *of_node = dev->of_node; |
1324 | 1324 | ||
1325 | return sprintf(buf, "%s\n", of_node ? of_node->full_name : "none"); | 1325 | return sprintf(buf, "%s\n", of_node ? of_node->full_name : "none"); |
1326 | } | 1326 | } |
@@ -1332,7 +1332,7 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, | |||
1332 | struct device_node *dn; | 1332 | struct device_node *dn; |
1333 | const char *cp; | 1333 | const char *cp; |
1334 | 1334 | ||
1335 | dn = dev->archdata.of_node; | 1335 | dn = dev->of_node; |
1336 | if (!dn) | 1336 | if (!dn) |
1337 | return -ENODEV; | 1337 | return -ENODEV; |
1338 | cp = of_get_property(dn, "compatible", NULL); | 1338 | cp = of_get_property(dn, "compatible", NULL); |
@@ -1370,7 +1370,7 @@ static int vio_hotplug(struct device *dev, struct kobj_uevent_env *env) | |||
1370 | struct device_node *dn; | 1370 | struct device_node *dn; |
1371 | const char *cp; | 1371 | const char *cp; |
1372 | 1372 | ||
1373 | dn = dev->archdata.of_node; | 1373 | dn = dev->of_node; |
1374 | if (!dn) | 1374 | if (!dn) |
1375 | return -ENODEV; | 1375 | return -ENODEV; |
1376 | cp = of_get_property(dn, "compatible", NULL); | 1376 | cp = of_get_property(dn, "compatible", NULL); |
@@ -1402,7 +1402,7 @@ static struct bus_type vio_bus_type = { | |||
1402 | */ | 1402 | */ |
1403 | const void *vio_get_attribute(struct vio_dev *vdev, char *which, int *length) | 1403 | const void *vio_get_attribute(struct vio_dev *vdev, char *which, int *length) |
1404 | { | 1404 | { |
1405 | return of_get_property(vdev->dev.archdata.of_node, which, length); | 1405 | return of_get_property(vdev->dev.of_node, which, length); |
1406 | } | 1406 | } |
1407 | EXPORT_SYMBOL(vio_get_attribute); | 1407 | EXPORT_SYMBOL(vio_get_attribute); |
1408 | 1408 | ||