diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2010-04-13 19:12:29 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2010-05-18 18:10:44 -0400 |
commit | 61c7a080a5a061c976988fd4b844dfb468dda255 (patch) | |
tree | 8cb492b73f2755c38a6164d770da34d5af6486a0 /arch/powerpc/kernel | |
parent | d12d42f744f805a9ccc33cd76f04b237cd83ce56 (diff) |
of: Always use 'struct device.of_node' to get device node pointer.
The following structure elements duplicate the information in
'struct device.of_node' and so are being eliminated. This patch
makes all readers of these elements use device.of_node instead.
(struct of_device *)->node
(struct dev_archdata *)->prom_node (sparc)
(struct dev_archdata *)->of_node (powerpc & microblaze)
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r-- | arch/powerpc/kernel/ibmebus.c | 4 | ||||
-rw-r--r-- | arch/powerpc/kernel/of_device.c | 8 | ||||
-rw-r--r-- | arch/powerpc/kernel/of_platform.c | 16 |
3 files changed, 14 insertions, 14 deletions
diff --git a/arch/powerpc/kernel/ibmebus.c b/arch/powerpc/kernel/ibmebus.c index 71cf280da184..a9f31631a293 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) |
diff --git a/arch/powerpc/kernel/of_device.c b/arch/powerpc/kernel/of_device.c index 9577e6f4e3bf..285c8490c547 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; |
@@ -96,17 +96,17 @@ int of_device_uevent(struct device *dev, struct kobj_uevent_env *env) | |||
96 | 96 | ||
97 | ofdev = to_of_device(dev); | 97 | ofdev = to_of_device(dev); |
98 | 98 | ||
99 | if (add_uevent_var(env, "OF_NAME=%s", ofdev->node->name)) | 99 | if (add_uevent_var(env, "OF_NAME=%s", ofdev->dev.of_node->name)) |
100 | return -ENOMEM; | 100 | return -ENOMEM; |
101 | 101 | ||
102 | if (add_uevent_var(env, "OF_TYPE=%s", ofdev->node->type)) | 102 | if (add_uevent_var(env, "OF_TYPE=%s", ofdev->dev.of_node->type)) |
103 | return -ENOMEM; | 103 | return -ENOMEM; |
104 | 104 | ||
105 | /* Since the compatible field can contain pretty much anything | 105 | /* Since the compatible field can contain pretty much anything |
106 | * it's not really legal to split it out with commas. We split it | 106 | * it's not really legal to split it out with commas. We split it |
107 | * up using a number of environment variables instead. */ | 107 | * up using a number of environment variables instead. */ |
108 | 108 | ||
109 | compat = of_get_property(ofdev->node, "compatible", &cplen); | 109 | compat = of_get_property(ofdev->dev.of_node, "compatible", &cplen); |
110 | while (compat && *compat && cplen > 0) { | 110 | while (compat && *compat && cplen > 0) { |
111 | if (add_uevent_var(env, "OF_COMPATIBLE_%d=%s", seen, compat)) | 111 | if (add_uevent_var(env, "OF_COMPATIBLE_%d=%s", seen, compat)) |
112 | return -ENOMEM; | 112 | return -ENOMEM; |
diff --git a/arch/powerpc/kernel/of_platform.c b/arch/powerpc/kernel/of_platform.c index 6c1dfc3ff8bc..1c747c474415 100644 --- a/arch/powerpc/kernel/of_platform.c +++ b/arch/powerpc/kernel/of_platform.c | |||
@@ -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 | ||