aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/macintosh/macio_asic.c
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2010-05-25 02:38:26 -0400
committerGrant Likely <grant.likely@secretlab.ca>2010-05-25 02:38:26 -0400
commitb1e50ebcf24668e57f058deb48b0704b5391ed0f (patch)
tree17e1b69b249d0738317b732186340c9dd053f1a1 /drivers/macintosh/macio_asic.c
parent0c2a2ae32793e3500a15a449612485f5d17dd431 (diff)
parent7e125f7b9cbfce4101191b8076d606c517a73066 (diff)
Merge remote branch 'origin' into secretlab/next-spi
Diffstat (limited to 'drivers/macintosh/macio_asic.c')
-rw-r--r--drivers/macintosh/macio_asic.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/drivers/macintosh/macio_asic.c b/drivers/macintosh/macio_asic.c
index 26a303a1d1ab..97147804a49c 100644
--- a/drivers/macintosh/macio_asic.c
+++ b/drivers/macintosh/macio_asic.c
@@ -39,14 +39,12 @@ static struct macio_chip *macio_on_hold;
39 39
40static int macio_bus_match(struct device *dev, struct device_driver *drv) 40static int macio_bus_match(struct device *dev, struct device_driver *drv)
41{ 41{
42 struct macio_dev * macio_dev = to_macio_device(dev); 42 const struct of_device_id * matches = drv->of_match_table;
43 struct macio_driver * macio_drv = to_macio_driver(drv);
44 const struct of_device_id * matches = macio_drv->match_table;
45 43
46 if (!matches) 44 if (!matches)
47 return 0; 45 return 0;
48 46
49 return of_match_device(matches, &macio_dev->ofdev) != NULL; 47 return of_match_device(matches, dev) != NULL;
50} 48}
51 49
52struct macio_dev *macio_dev_get(struct macio_dev *dev) 50struct macio_dev *macio_dev_get(struct macio_dev *dev)
@@ -84,7 +82,7 @@ static int macio_device_probe(struct device *dev)
84 82
85 macio_dev_get(macio_dev); 83 macio_dev_get(macio_dev);
86 84
87 match = of_match_device(drv->match_table, &macio_dev->ofdev); 85 match = of_match_device(drv->driver.of_match_table, dev);
88 if (match) 86 if (match)
89 error = drv->probe(macio_dev, match); 87 error = drv->probe(macio_dev, match);
90 if (error) 88 if (error)
@@ -248,7 +246,7 @@ static void macio_create_fixup_irq(struct macio_dev *dev, int index,
248 246
249static void macio_add_missing_resources(struct macio_dev *dev) 247static void macio_add_missing_resources(struct macio_dev *dev)
250{ 248{
251 struct device_node *np = dev->ofdev.node; 249 struct device_node *np = dev->ofdev.dev.of_node;
252 unsigned int irq_base; 250 unsigned int irq_base;
253 251
254 /* Gatwick has some missing interrupts on child nodes */ 252 /* Gatwick has some missing interrupts on child nodes */
@@ -289,7 +287,7 @@ static void macio_add_missing_resources(struct macio_dev *dev)
289 287
290static void macio_setup_interrupts(struct macio_dev *dev) 288static void macio_setup_interrupts(struct macio_dev *dev)
291{ 289{
292 struct device_node *np = dev->ofdev.node; 290 struct device_node *np = dev->ofdev.dev.of_node;
293 unsigned int irq; 291 unsigned int irq;
294 int i = 0, j = 0; 292 int i = 0, j = 0;
295 293
@@ -317,7 +315,7 @@ static void macio_setup_interrupts(struct macio_dev *dev)
317static void macio_setup_resources(struct macio_dev *dev, 315static void macio_setup_resources(struct macio_dev *dev,
318 struct resource *parent_res) 316 struct resource *parent_res)
319{ 317{
320 struct device_node *np = dev->ofdev.node; 318 struct device_node *np = dev->ofdev.dev.of_node;
321 struct resource r; 319 struct resource r;
322 int index; 320 int index;
323 321
@@ -373,9 +371,9 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip,
373 371
374 dev->bus = &chip->lbus; 372 dev->bus = &chip->lbus;
375 dev->media_bay = in_bay; 373 dev->media_bay = in_bay;
376 dev->ofdev.node = np; 374 dev->ofdev.dev.of_node = np;
377 dev->ofdev.dma_mask = 0xffffffffUL; 375 dev->ofdev.archdata.dma_mask = 0xffffffffUL;
378 dev->ofdev.dev.dma_mask = &dev->ofdev.dma_mask; 376 dev->ofdev.dev.dma_mask = &dev->ofdev.archdata.dma_mask;
379 dev->ofdev.dev.parent = parent; 377 dev->ofdev.dev.parent = parent;
380 dev->ofdev.dev.bus = &macio_bus_type; 378 dev->ofdev.dev.bus = &macio_bus_type;
381 dev->ofdev.dev.release = macio_release_dev; 379 dev->ofdev.dev.release = macio_release_dev;
@@ -494,9 +492,9 @@ static void macio_pci_add_devices(struct macio_chip *chip)
494 } 492 }
495 493
496 /* Add media bay devices if any */ 494 /* Add media bay devices if any */
495 pnode = mbdev->ofdev.dev.of_node;
497 if (mbdev) 496 if (mbdev)
498 for (np = NULL; (np = of_get_next_child(mbdev->ofdev.node, np)) 497 for (np = NULL; (np = of_get_next_child(pnode, np)) != NULL;) {
499 != NULL;) {
500 if (macio_skip_device(np)) 498 if (macio_skip_device(np))
501 continue; 499 continue;
502 of_node_get(np); 500 of_node_get(np);
@@ -506,9 +504,9 @@ static void macio_pci_add_devices(struct macio_chip *chip)
506 } 504 }
507 505
508 /* Add serial ports if any */ 506 /* Add serial ports if any */
507 pnode = sdev->ofdev.dev.of_node;
509 if (sdev) { 508 if (sdev) {
510 for (np = NULL; (np = of_get_next_child(sdev->ofdev.node, np)) 509 for (np = NULL; (np = of_get_next_child(pnode, np)) != NULL;) {
511 != NULL;) {
512 if (macio_skip_device(np)) 510 if (macio_skip_device(np))
513 continue; 511 continue;
514 of_node_get(np); 512 of_node_get(np);