Commit c2f6fabb authored by Bjorn Helgaas's avatar Bjorn Helgaas Committed by Linus Torvalds

[PATCH] EISA: tidy-up driver_register() return value

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.
Signed-off-by: default avatarBjorn Helgaas <bjorn.helgaas@hp.com>
Acked-by: default avatarJeff Garzik <jgarzik@pobox.com>
Acked-by: default avatarMarc Zyngier <maz@misterjones.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent e51c01b0
...@@ -135,13 +135,8 @@ struct bus_type eisa_bus_type = { ...@@ -135,13 +135,8 @@ struct bus_type eisa_bus_type = {
int eisa_driver_register (struct eisa_driver *edrv) int eisa_driver_register (struct eisa_driver *edrv)
{ {
int r;
edrv->driver.bus = &eisa_bus_type; edrv->driver.bus = &eisa_bus_type;
if ((r = driver_register (&edrv->driver)) < 0) return driver_register (&edrv->driver);
return r;
return 0;
} }
void eisa_driver_unregister (struct eisa_driver *edrv) void eisa_driver_unregister (struct eisa_driver *edrv)
......
...@@ -1096,14 +1096,18 @@ static int __init vortex_eisa_init (void) ...@@ -1096,14 +1096,18 @@ static int __init vortex_eisa_init (void)
int orig_cards_found = vortex_cards_found; int orig_cards_found = vortex_cards_found;
#ifdef CONFIG_EISA #ifdef CONFIG_EISA
if (eisa_driver_register (&vortex_eisa_driver) >= 0) { int err;
/* Because of the way EISA bus is probed, we cannot assume
* any device have been found when we exit from err = eisa_driver_register (&vortex_eisa_driver);
* eisa_driver_register (the bus root driver may not be if (!err) {
* initialized yet). So we blindly assume something was /*
* found, and let the sysfs magic happend... */ * Because of the way EISA bus is probed, we cannot assume
* any device have been found when we exit from
eisa_found = 1; * eisa_driver_register (the bus root driver may not be
* initialized yet). So we blindly assume something was
* found, and let the sysfs magic happend...
*/
eisa_found = 1;
} }
#endif #endif
......
...@@ -1551,7 +1551,7 @@ MODULE_PARM_DESC(nicmode, "Digi RightSwitch operating mode (1: switch, 2: multi- ...@@ -1551,7 +1551,7 @@ MODULE_PARM_DESC(nicmode, "Digi RightSwitch operating mode (1: switch, 2: multi-
static int __init dgrs_init_module (void) static int __init dgrs_init_module (void)
{ {
int i; int i;
int cardcount = 0; int err;
/* /*
* Command line variable overrides * Command line variable overrides
...@@ -1593,13 +1593,13 @@ static int __init dgrs_init_module (void) ...@@ -1593,13 +1593,13 @@ static int __init dgrs_init_module (void)
* Find and configure all the cards * Find and configure all the cards
*/ */
#ifdef CONFIG_EISA #ifdef CONFIG_EISA
cardcount = eisa_driver_register(&dgrs_eisa_driver); err = eisa_driver_register(&dgrs_eisa_driver);
if (cardcount < 0) if (err)
return cardcount; return err;
#endif #endif
cardcount = pci_register_driver(&dgrs_pci_driver); err = pci_register_driver(&dgrs_pci_driver);
if (cardcount) if (err)
return cardcount; return err;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment