X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fmacintosh%2Fmacio-adb.c;h=79119f56e82def706ce517bfdb8e9dcebc1eb3d3;hb=cbd6712406a3ea861b49fbfd46e23cbf5f8e073f;hp=57ccc19cbdbf9f6dccb4c7c02347b1afbaac3188;hpb=44aefd2706bb6f5b65ba2c38cd89e7609e2b43d3;p=linux-2.6-omap-h63xx.git diff --git a/drivers/macintosh/macio-adb.c b/drivers/macintosh/macio-adb.c index 57ccc19cbdb..79119f56e82 100644 --- a/drivers/macintosh/macio-adb.c +++ b/drivers/macintosh/macio-adb.c @@ -6,7 +6,6 @@ #include #include #include -#include #include #include #include @@ -83,7 +82,14 @@ struct adb_driver macio_adb_driver = { int macio_probe(void) { - return find_compatible_devices("adb", "chrp,adb0")? 0: -ENODEV; + struct device_node *np; + + np = of_find_compatible_node(NULL, "adb", "chrp,adb0"); + if (np) { + of_node_put(np); + return 0; + } + return -ENODEV; } int macio_init(void) @@ -92,12 +98,14 @@ int macio_init(void) struct resource r; unsigned int irq; - adbs = find_compatible_devices("adb", "chrp,adb0"); + adbs = of_find_compatible_node(NULL, "adb", "chrp,adb0"); if (adbs == 0) return -ENXIO; - if (of_address_to_resource(adbs, 0, &r)) + if (of_address_to_resource(adbs, 0, &r)) { + of_node_put(adbs); return -ENXIO; + } adb = ioremap(r.start, sizeof(struct adb_regs)); out_8(&adb->ctrl.r, 0); @@ -108,6 +116,7 @@ int macio_init(void) out_8(&adb->autopoll.r, APE); irq = irq_of_parse_and_map(adbs, 0); + of_node_put(adbs); if (request_irq(irq, macio_adb_interrupt, 0, "ADB", (void *)0)) { printk(KERN_ERR "ADB: can't get irq %d\n", irq); return -EAGAIN; @@ -270,6 +279,6 @@ static void macio_adb_poll(void) local_irq_save(flags); if (in_8(&adb->intr.r) != 0) - macio_adb_interrupt(0, NULL, NULL); + macio_adb_interrupt(0, NULL); local_irq_restore(flags); }