]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/char/agp/parisc-agp.c
Merge branch 'devel' of git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa...
[linux-2.6-omap-h63xx.git] / drivers / char / agp / parisc-agp.c
index db60539bf67a1ed81216b35f29819cadfc43a83c..699e3422ad93363c9210edee97345dec6d18e758 100644 (file)
@@ -359,9 +359,16 @@ fail:
        return error;
 }
 
-static struct device *next_device(struct klist_iter *i) {
-       struct klist_node * n = klist_next(i);
-       return n ? container_of(n, struct device, knode_parent) : NULL;
+static int
+find_quicksilver(struct device *dev, void *data)
+{
+       struct parisc_device **lba = data;
+       struct parisc_device *padev = to_parisc_device(dev);
+
+       if (IS_QUICKSILVER(padev))
+               *lba = padev;
+
+       return 0;
 }
 
 static int
@@ -372,8 +379,6 @@ parisc_agp_init(void)
        int err = -1;
        struct parisc_device *sba = NULL, *lba = NULL;
        struct lba_device *lbadev = NULL;
-       struct device *dev = NULL;
-       struct klist_iter i;
 
        if (!sba_list)
                goto out;
@@ -386,13 +391,7 @@ parisc_agp_init(void)
        }
 
        /* Now search our Pluto for our precious AGP device... */
-       klist_iter_init(&sba->dev.klist_children, &i);
-       while ((dev = next_device(&i))) {
-               struct parisc_device *padev = to_parisc_device(dev);
-               if (IS_QUICKSILVER(padev))
-                       lba = padev;
-       }
-       klist_iter_exit(&i);
+       device_for_each_child(&sba->dev, &lba, find_quicksilver);
 
        if (!lba) {
                printk(KERN_INFO DRVPFX "No AGP devices found.\n");