aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/zorro.h
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2006-03-25 06:07:20 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-25 11:22:53 -0500
commit33d8675ea66e79d21da3ed64ce88dfb2a18bc6a7 (patch)
tree7283a680e122e4d15f50e818bab188b84fc852a9 /include/linux/zorro.h
parentc2f6fabb2ed3b869bc254c6cdc73d6beaaaf700f (diff)
[PATCH] amiga: fix driver_register() return handling, remove zorro_module_init()
Remove the assumption that driver_register() returns the number of devices bound to the driver. In fact, it returns zero for success or a negative error value. zorro_module_init() used the device count to automatically unregister and unload drivers that found no devices. That might have worked at one time, but has been broken for some time because zorro_register_driver() returned either a negative error or a positive count (never zero). So it could only unregister on failure, when it's not needed anyway. This functionality could be resurrected in individual drivers by counting devices in their .probe() methods. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Roman Zippel <zippel@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/zorro.h')
-rw-r--r--include/linux/zorro.h33
1 files changed, 0 insertions, 33 deletions
diff --git a/include/linux/zorro.h b/include/linux/zorro.h
index ba5b72768bbe..2f135cf6eef1 100644
--- a/include/linux/zorro.h
+++ b/include/linux/zorro.h
@@ -271,39 +271,6 @@ static inline void zorro_set_drvdata (struct zorro_dev *z, void *data)
271} 271}
272 272
273 273
274/*
275 * A helper function which helps ensure correct zorro_driver
276 * setup and cleanup for commonly-encountered hotplug/modular cases
277 *
278 * This MUST stay in a header, as it checks for -DMODULE
279 */
280static inline int zorro_module_init(struct zorro_driver *drv)
281{
282 int rc = zorro_register_driver(drv);
283
284 if (rc > 0)
285 return 0;
286
287 /* iff CONFIG_HOTPLUG and built into kernel, we should
288 * leave the driver around for future hotplug events.
289 * For the module case, a hotplug daemon of some sort
290 * should load a module in response to an insert event. */
291#if defined(CONFIG_HOTPLUG) && !defined(MODULE)
292 if (rc == 0)
293 return 0;
294#else
295 if (rc == 0)
296 rc = -ENODEV;
297#endif
298
299 /* if we get here, we need to clean up Zorro driver instance
300 * and return some sort of error */
301 zorro_unregister_driver(drv);
302
303 return rc;
304}
305
306
307 /* 274 /*
308 * Bitmask indicating portions of available Zorro II RAM that are unused 275 * Bitmask indicating portions of available Zorro II RAM that are unused
309 * by the system. Every bit represents a 64K chunk, for a maximum of 8MB 276 * by the system. Every bit represents a 64K chunk, for a maximum of 8MB