aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/macintosh
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2010-04-13 19:12:29 -0400
committerGrant Likely <grant.likely@secretlab.ca>2010-05-18 18:10:44 -0400
commit61c7a080a5a061c976988fd4b844dfb468dda255 (patch)
tree8cb492b73f2755c38a6164d770da34d5af6486a0 /drivers/macintosh
parentd12d42f744f805a9ccc33cd76f04b237cd83ce56 (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 'drivers/macintosh')
-rw-r--r--drivers/macintosh/macio_asic.c16
-rw-r--r--drivers/macintosh/macio_sysfs.c6
-rw-r--r--drivers/macintosh/mediabay.c2
-rw-r--r--drivers/macintosh/rack-meter.c4
-rw-r--r--drivers/macintosh/therm_pm72.c2
5 files changed, 15 insertions, 15 deletions
diff --git a/drivers/macintosh/macio_asic.c b/drivers/macintosh/macio_asic.c
index 26a303a1d1ab..67fe13ffe90b 100644
--- a/drivers/macintosh/macio_asic.c
+++ b/drivers/macintosh/macio_asic.c
@@ -248,7 +248,7 @@ static void macio_create_fixup_irq(struct macio_dev *dev, int index,
248 248
249static void macio_add_missing_resources(struct macio_dev *dev) 249static void macio_add_missing_resources(struct macio_dev *dev)
250{ 250{
251 struct device_node *np = dev->ofdev.node; 251 struct device_node *np = dev->ofdev.dev.of_node;
252 unsigned int irq_base; 252 unsigned int irq_base;
253 253
254 /* Gatwick has some missing interrupts on child nodes */ 254 /* Gatwick has some missing interrupts on child nodes */
@@ -289,7 +289,7 @@ static void macio_add_missing_resources(struct macio_dev *dev)
289 289
290static void macio_setup_interrupts(struct macio_dev *dev) 290static void macio_setup_interrupts(struct macio_dev *dev)
291{ 291{
292 struct device_node *np = dev->ofdev.node; 292 struct device_node *np = dev->ofdev.dev.of_node;
293 unsigned int irq; 293 unsigned int irq;
294 int i = 0, j = 0; 294 int i = 0, j = 0;
295 295
@@ -317,7 +317,7 @@ static void macio_setup_interrupts(struct macio_dev *dev)
317static void macio_setup_resources(struct macio_dev *dev, 317static void macio_setup_resources(struct macio_dev *dev,
318 struct resource *parent_res) 318 struct resource *parent_res)
319{ 319{
320 struct device_node *np = dev->ofdev.node; 320 struct device_node *np = dev->ofdev.dev.of_node;
321 struct resource r; 321 struct resource r;
322 int index; 322 int index;
323 323
@@ -373,7 +373,7 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip,
373 373
374 dev->bus = &chip->lbus; 374 dev->bus = &chip->lbus;
375 dev->media_bay = in_bay; 375 dev->media_bay = in_bay;
376 dev->ofdev.node = np; 376 dev->ofdev.dev.of_node = np;
377 dev->ofdev.dma_mask = 0xffffffffUL; 377 dev->ofdev.dma_mask = 0xffffffffUL;
378 dev->ofdev.dev.dma_mask = &dev->ofdev.dma_mask; 378 dev->ofdev.dev.dma_mask = &dev->ofdev.dma_mask;
379 dev->ofdev.dev.parent = parent; 379 dev->ofdev.dev.parent = parent;
@@ -494,9 +494,9 @@ static void macio_pci_add_devices(struct macio_chip *chip)
494 } 494 }
495 495
496 /* Add media bay devices if any */ 496 /* Add media bay devices if any */
497 pnode = mbdev->ofdev.dev.of_node;
497 if (mbdev) 498 if (mbdev)
498 for (np = NULL; (np = of_get_next_child(mbdev->ofdev.node, np)) 499 for (np = NULL; (np = of_get_next_child(pnode, np)) != NULL;) {
499 != NULL;) {
500 if (macio_skip_device(np)) 500 if (macio_skip_device(np))
501 continue; 501 continue;
502 of_node_get(np); 502 of_node_get(np);
@@ -506,9 +506,9 @@ static void macio_pci_add_devices(struct macio_chip *chip)
506 } 506 }
507 507
508 /* Add serial ports if any */ 508 /* Add serial ports if any */
509 pnode = sdev->ofdev.dev.of_node;
509 if (sdev) { 510 if (sdev) {
510 for (np = NULL; (np = of_get_next_child(sdev->ofdev.node, np)) 511 for (np = NULL; (np = of_get_next_child(pnode, np)) != NULL;) {
511 != NULL;) {
512 if (macio_skip_device(np)) 512 if (macio_skip_device(np))
513 continue; 513 continue;
514 of_node_get(np); 514 of_node_get(np);
diff --git a/drivers/macintosh/macio_sysfs.c b/drivers/macintosh/macio_sysfs.c
index 9e9453b58425..6999ce59fd10 100644
--- a/drivers/macintosh/macio_sysfs.c
+++ b/drivers/macintosh/macio_sysfs.c
@@ -9,7 +9,7 @@ field##_show (struct device *dev, struct device_attribute *attr, \
9 char *buf) \ 9 char *buf) \
10{ \ 10{ \
11 struct macio_dev *mdev = to_macio_device (dev); \ 11 struct macio_dev *mdev = to_macio_device (dev); \
12 return sprintf (buf, format_string, mdev->ofdev.node->field); \ 12 return sprintf (buf, format_string, mdev->ofdev.dev.of_node->field); \
13} 13}
14 14
15static ssize_t 15static ssize_t
@@ -21,7 +21,7 @@ compatible_show (struct device *dev, struct device_attribute *attr, char *buf)
21 int length = 0; 21 int length = 0;
22 22
23 of = &to_macio_device (dev)->ofdev; 23 of = &to_macio_device (dev)->ofdev;
24 compat = of_get_property(of->node, "compatible", &cplen); 24 compat = of_get_property(of->dev.of_node, "compatible", &cplen);
25 if (!compat) { 25 if (!compat) {
26 *buf = '\0'; 26 *buf = '\0';
27 return 0; 27 return 0;
@@ -58,7 +58,7 @@ static ssize_t devspec_show(struct device *dev,
58 struct of_device *ofdev; 58 struct of_device *ofdev;
59 59
60 ofdev = to_of_device(dev); 60 ofdev = to_of_device(dev);
61 return sprintf(buf, "%s\n", ofdev->node->full_name); 61 return sprintf(buf, "%s\n", ofdev->dev.of_node->full_name);
62} 62}
63 63
64macio_config_of_attr (name, "%s\n"); 64macio_config_of_attr (name, "%s\n");
diff --git a/drivers/macintosh/mediabay.c b/drivers/macintosh/mediabay.c
index 08002b88f342..288acce76b74 100644
--- a/drivers/macintosh/mediabay.c
+++ b/drivers/macintosh/mediabay.c
@@ -564,7 +564,7 @@ static int __devinit media_bay_attach(struct macio_dev *mdev, const struct of_de
564 unsigned long base; 564 unsigned long base;
565 int i; 565 int i;
566 566
567 ofnode = mdev->ofdev.node; 567 ofnode = mdev->ofdev.dev.of_node;
568 568
569 if (macio_resource_count(mdev) < 1) 569 if (macio_resource_count(mdev) < 1)
570 return -ENODEV; 570 return -ENODEV;
diff --git a/drivers/macintosh/rack-meter.c b/drivers/macintosh/rack-meter.c
index 7c54d80c4fb2..12946c5f583f 100644
--- a/drivers/macintosh/rack-meter.c
+++ b/drivers/macintosh/rack-meter.c
@@ -375,7 +375,7 @@ static int __devinit rackmeter_probe(struct macio_dev* mdev,
375 pr_debug("rackmeter_probe()\n"); 375 pr_debug("rackmeter_probe()\n");
376 376
377 /* Get i2s-a node */ 377 /* Get i2s-a node */
378 while ((i2s = of_get_next_child(mdev->ofdev.node, i2s)) != NULL) 378 while ((i2s = of_get_next_child(mdev->ofdev.dev.of_node, i2s)) != NULL)
379 if (strcmp(i2s->name, "i2s-a") == 0) 379 if (strcmp(i2s->name, "i2s-a") == 0)
380 break; 380 break;
381 if (i2s == NULL) { 381 if (i2s == NULL) {
@@ -431,7 +431,7 @@ static int __devinit rackmeter_probe(struct macio_dev* mdev,
431 of_address_to_resource(i2s, 1, &rdma)) { 431 of_address_to_resource(i2s, 1, &rdma)) {
432 printk(KERN_ERR 432 printk(KERN_ERR
433 "rackmeter: found match but lacks resources: %s", 433 "rackmeter: found match but lacks resources: %s",
434 mdev->ofdev.node->full_name); 434 mdev->ofdev.dev.of_node->full_name);
435 rc = -ENXIO; 435 rc = -ENXIO;
436 goto bail_free; 436 goto bail_free;
437 } 437 }
diff --git a/drivers/macintosh/therm_pm72.c b/drivers/macintosh/therm_pm72.c
index b18fa948f3d1..9314be9a2fc8 100644
--- a/drivers/macintosh/therm_pm72.c
+++ b/drivers/macintosh/therm_pm72.c
@@ -2215,7 +2215,7 @@ static int fcu_of_probe(struct of_device* dev, const struct of_device_id *match)
2215 state = state_detached; 2215 state = state_detached;
2216 2216
2217 /* Lookup the fans in the device tree */ 2217 /* Lookup the fans in the device tree */
2218 fcu_lookup_fans(dev->node); 2218 fcu_lookup_fans(dev->dev.of_node);
2219 2219
2220 /* Add the driver */ 2220 /* Add the driver */
2221 return i2c_add_driver(&therm_pm72_driver); 2221 return i2c_add_driver(&therm_pm72_driver);