Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 33d8675e authored by Bjorn Helgaas's avatar Bjorn Helgaas Committed by Linus Torvalds
Browse files

[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: default avatarBjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent c2f6fabb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -829,7 +829,7 @@ static void __devexit a2065_remove_one(struct zorro_dev *z)

static int __init a2065_init_module(void)
{
	return zorro_module_init(&a2065_driver);
	return zorro_register_driver(&a2065_driver);
}

static void __exit a2065_cleanup_module(void)
+1 −1
Original line number Diff line number Diff line
@@ -864,7 +864,7 @@ static void __devexit ariadne_remove_one(struct zorro_dev *z)

static int __init ariadne_init_module(void)
{
    return zorro_module_init(&ariadne_driver);
    return zorro_register_driver(&ariadne_driver);
}

static void __exit ariadne_cleanup_module(void)
+1 −1
Original line number Diff line number Diff line
@@ -242,7 +242,7 @@ static void __devexit hydra_remove_one(struct zorro_dev *z)

static int __init hydra_init_module(void)
{
    return zorro_module_init(&hydra_driver);
    return zorro_register_driver(&hydra_driver);
}

static void __exit hydra_cleanup_module(void)
+1 −1
Original line number Diff line number Diff line
@@ -426,7 +426,7 @@ static void __devexit zorro8390_remove_one(struct zorro_dev *z)

static int __init zorro8390_init_module(void)
{
    return zorro_module_init(&zorro8390_driver);
    return zorro_register_driver(&zorro8390_driver);
}

static void __exit zorro8390_cleanup_module(void)
+1 −1
Original line number Diff line number Diff line
@@ -2622,7 +2622,7 @@ static int __init cirrusfb_init(void)
#endif

#ifdef CONFIG_ZORRO
	error |= zorro_module_init(&cirrusfb_zorro_driver);
	error |= zorro_register_driver(&cirrusfb_zorro_driver);
#endif
#ifdef CONFIG_PCI
	error |= pci_register_driver(&cirrusfb_pci_driver);
Loading