git://ftp.safe.ca
/
safe
/
jmp
/
linux-2.6
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge master.kernel.org:/home/rmk/linux-2.6-arm
[safe/jmp/linux-2.6]
/
drivers
/
zorro
/
zorro-driver.c
diff --git
a/drivers/zorro/zorro-driver.c
b/drivers/zorro/zorro-driver.c
index
fcbee74
..
e6c4390
100644
(file)
--- a/
drivers/zorro/zorro-driver.c
+++ b/
drivers/zorro/zorro-driver.c
@@
-60,27
+60,36
@@
static int zorro_device_probe(struct device *dev)
}
}
+static int zorro_device_remove(struct device *dev)
+{
+ struct zorro_dev *z = to_zorro_dev(dev);
+ struct zorro_driver *drv = to_zorro_driver(dev->driver);
+
+ if (drv) {
+ if (drv->remove)
+ drv->remove(z);
+ z->driver = NULL;
+ }
+ return 0;
+}
+
+
/**
* zorro_register_driver - register a new Zorro driver
* @drv: the driver structure to register
*
* Adds the driver structure to the list of registered drivers
/**
* zorro_register_driver - register a new Zorro driver
* @drv: the driver structure to register
*
* Adds the driver structure to the list of registered drivers
- * Returns the number of Zorro devices which were claimed by the driver
- * during registration. The driver remains registered even if the
- * return value is zero.
+ * Returns zero or a negative error value.
*/
int zorro_register_driver(struct zorro_driver *drv)
{
*/
int zorro_register_driver(struct zorro_driver *drv)
{
- int count = 0;
-
/* initialize common driver fields */
drv->driver.name = drv->name;
drv->driver.bus = &zorro_bus_type;
/* register with core */
/* initialize common driver fields */
drv->driver.name = drv->name;
drv->driver.bus = &zorro_bus_type;
/* register with core */
- count = driver_register(&drv->driver);
- return count ? count : 1;
+ return driver_register(&drv->driver);
}
}
@@
-133,6
+142,7
@@
struct bus_type zorro_bus_type = {
.name = "zorro",
.match = zorro_bus_match,
.probe = zorro_device_probe,
.name = "zorro",
.match = zorro_bus_match,
.probe = zorro_device_probe,
+ .remove = zorro_device_remove,
};
};