aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/macintosh/macio-adb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/macintosh/macio-adb.c')
-rw-r--r--drivers/macintosh/macio-adb.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/macintosh/macio-adb.c b/drivers/macintosh/macio-adb.c
index 026b67f4f659..79119f56e82d 100644
--- a/drivers/macintosh/macio-adb.c
+++ b/drivers/macintosh/macio-adb.c
@@ -82,7 +82,14 @@ struct adb_driver macio_adb_driver = {
82 82
83int macio_probe(void) 83int macio_probe(void)
84{ 84{
85 return find_compatible_devices("adb", "chrp,adb0")? 0: -ENODEV; 85 struct device_node *np;
86
87 np = of_find_compatible_node(NULL, "adb", "chrp,adb0");
88 if (np) {
89 of_node_put(np);
90 return 0;
91 }
92 return -ENODEV;
86} 93}
87 94
88int macio_init(void) 95int macio_init(void)
@@ -91,12 +98,14 @@ int macio_init(void)
91 struct resource r; 98 struct resource r;
92 unsigned int irq; 99 unsigned int irq;
93 100
94 adbs = find_compatible_devices("adb", "chrp,adb0"); 101 adbs = of_find_compatible_node(NULL, "adb", "chrp,adb0");
95 if (adbs == 0) 102 if (adbs == 0)
96 return -ENXIO; 103 return -ENXIO;
97 104
98 if (of_address_to_resource(adbs, 0, &r)) 105 if (of_address_to_resource(adbs, 0, &r)) {
106 of_node_put(adbs);
99 return -ENXIO; 107 return -ENXIO;
108 }
100 adb = ioremap(r.start, sizeof(struct adb_regs)); 109 adb = ioremap(r.start, sizeof(struct adb_regs));
101 110
102 out_8(&adb->ctrl.r, 0); 111 out_8(&adb->ctrl.r, 0);
@@ -107,6 +116,7 @@ int macio_init(void)
107 out_8(&adb->autopoll.r, APE); 116 out_8(&adb->autopoll.r, APE);
108 117
109 irq = irq_of_parse_and_map(adbs, 0); 118 irq = irq_of_parse_and_map(adbs, 0);
119 of_node_put(adbs);
110 if (request_irq(irq, macio_adb_interrupt, 0, "ADB", (void *)0)) { 120 if (request_irq(irq, macio_adb_interrupt, 0, "ADB", (void *)0)) {
111 printk(KERN_ERR "ADB: can't get irq %d\n", irq); 121 printk(KERN_ERR "ADB: can't get irq %d\n", irq);
112 return -EAGAIN; 122 return -EAGAIN;