From 982c609448b9d724e1c3a0d5aeee388c064479f0 Mon Sep 17 00:00:00 2001 From: Bjorn Helgaas Date: Mon, 27 Mar 2006 01:17:08 -0800 Subject: [PATCH] pnp: PNP: adjust pnp_register_driver signature Remove the assumption that pnp_register_driver() returns the number of devices claimed. Returning the count is unreliable because devices may be hot-plugged in the future. This changes the convention to "zero for success, or a negative error value," which matches pci_register_driver(), acpi_bus_register_driver(), and platform_driver_register(). Signed-off-by: Bjorn Helgaas Cc: Adam Belay Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/pnp/driver.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'drivers/pnp/driver.c') diff --git a/drivers/pnp/driver.c b/drivers/pnp/driver.c index 7cafacdd12b0..e54c15383193 100644 --- a/drivers/pnp/driver.c +++ b/drivers/pnp/driver.c @@ -201,31 +201,14 @@ struct bus_type pnp_bus_type = { .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 count; - pnp_dbg("the driver '%s' has been registered", drv->name); drv->driver.name = drv->name; drv->driver.bus = &pnp_bus_type; - 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; + return driver_register(&drv->driver); } void pnp_unregister_driver(struct pnp_driver *drv) -- cgit v1.2.3