git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git]
/
drivers
/
pnp
/
driver.c
diff --git
a/drivers/pnp/driver.c
b/drivers/pnp/driver.c
index
e54c153
..
7cafacd
100644
(file)
--- a/
drivers/pnp/driver.c
+++ b/
drivers/pnp/driver.c
@@
-201,14
+201,31
@@
struct bus_type pnp_bus_type = {
.resume = pnp_bus_resume,
};
.resume = pnp_bus_resume,
};
+
+static int count_devices(struct device * dev, void * c)
+{
+ int * count = c;
+ (*count)++;
+ return 0;
+}
+
int pnp_register_driver(struct pnp_driver *drv)
{
int pnp_register_driver(struct pnp_driver *drv)
{
+ int count;
+
pnp_dbg("the driver '%s' has been registered", drv->name);
drv->driver.name = drv->name;
drv->driver.bus = &pnp_bus_type;
pnp_dbg("the driver '%s' has been registered", drv->name);
drv->driver.name = drv->name;
drv->driver.bus = &pnp_bus_type;
- return driver_register(&drv->driver);
+ count = driver_register(&drv->driver);
+
+ /* get the number of initial matches */
+ if (count >= 0){
+ count = 0;
+ driver_for_each_device(&drv->driver, NULL, &count, count_devices);
+ }
+ return count;
}
void pnp_unregister_driver(struct pnp_driver *drv)
}
void pnp_unregister_driver(struct pnp_driver *drv)