]> err.no Git - linux-2.6/blobdiff - drivers/pnp/driver.c
Merge /spare/repo/linux-2.6/
[linux-2.6] / drivers / pnp / driver.c
index d64c1ca4fa76db7f77902f94b0baf840c78dc020..33da25f3213f4614a6dc338b9743034452dab3de 100644 (file)
 #include <linux/module.h>
 #include <linux/ctype.h>
 #include <linux/slab.h>
-
-#ifdef CONFIG_PNP_DEBUG
-       #define DEBUG
-#else
-       #undef DEBUG
-#endif
-
 #include <linux/pnp.h>
 #include "base.h"
 
@@ -160,10 +153,16 @@ struct bus_type pnp_bus_type = {
 };
 
 
+static int count_devices(struct device * dev, void * c)
+{
+       int * count = c;
+       (*count)++;
+       return 0;
+}
+
 int pnp_register_driver(struct pnp_driver *drv)
 {
        int count;
-       struct list_head *pos;
 
        pnp_dbg("the driver '%s' has been registered", drv->name);
 
@@ -177,9 +176,7 @@ int pnp_register_driver(struct pnp_driver *drv)
        /* get the number of initial matches */
        if (count >= 0){
                count = 0;
-               list_for_each(pos,&drv->driver.devices){
-                       count++;
-               }
+               driver_for_each_device(&drv->driver, NULL, &count, count_devices);
        }
        return count;
 }