diff options
author | Bjorn Helgaas <bjorn.helgaas@hp.com> | 2006-03-25 06:07:17 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-25 11:22:53 -0500 |
commit | e51c01b08474ea454a965a937fff0407ab6714c7 (patch) | |
tree | 403e22aa86b4a24699df7cc1285ab915ec3eda1a /drivers/video/hpfb.c | |
parent | 5930860296ca438071d3824bf7306ad0dfd33fc1 (diff) |
[PATCH] hp300: fix driver_register() return handling, remove dio_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.
dio_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 dio_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: Philip Blundell <philb@gnu.org>
Cc: Jochen Friedrich <jochen@scram.de>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/video/hpfb.c')
-rw-r--r-- | drivers/video/hpfb.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/video/hpfb.c b/drivers/video/hpfb.c index bebdac59d231..abd920a663a0 100644 --- a/drivers/video/hpfb.c +++ b/drivers/video/hpfb.c | |||
@@ -386,7 +386,9 @@ int __init hpfb_init(void) | |||
386 | if (fb_get_options("hpfb", NULL)) | 386 | if (fb_get_options("hpfb", NULL)) |
387 | return -ENODEV; | 387 | return -ENODEV; |
388 | 388 | ||
389 | dio_module_init(&hpfb_driver); | 389 | err = dio_register_driver(&hpfb_driver); |
390 | if (err) | ||
391 | return err; | ||
390 | 392 | ||
391 | fs = get_fs(); | 393 | fs = get_fs(); |
392 | set_fs(KERNEL_DS); | 394 | set_fs(KERNEL_DS); |