Skip to content

Commit c2f6fab

Browse files
Bjorn HelgaasLinus Torvalds
authored andcommitted
[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: Bjorn Helgaas <bjorn.helgaas@hp.com> Acked-by: Jeff Garzik <jgarzik@pobox.com> Acked-by: Marc Zyngier <maz@misterjones.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent e51c01b commit c2f6fab

3 files changed

Lines changed: 20 additions & 21 deletions

File tree

‎drivers/eisa/eisa-bus.c‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,8 @@ struct bus_type eisa_bus_type = {
135135

136136
int eisa_driver_register (struct eisa_driver *edrv)
137137
{
138-
int r;
139-
140138
edrv->driver.bus = &eisa_bus_type;
141-
if ((r = driver_register (&edrv->driver)) < 0)
142-
return r;
143-
144-
return 0;
139+
return driver_register (&edrv->driver);
145140
}
146141

147142
void eisa_driver_unregister (struct eisa_driver *edrv)

‎drivers/net/3c59x.c‎

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,14 +1096,18 @@ static int __init vortex_eisa_init (void)
10961096
int orig_cards_found = vortex_cards_found;
10971097

10981098
#ifdef CONFIG_EISA
1099-
if (eisa_driver_register (&vortex_eisa_driver) >= 0) {
1100-
/* Because of the way EISA bus is probed, we cannot assume
1101-
* any device have been found when we exit from
1102-
* eisa_driver_register (the bus root driver may not be
1103-
* initialized yet). So we blindly assume something was
1104-
* found, and let the sysfs magic happend... */
1105-
1106-
eisa_found = 1;
1099+
int err;
1100+
1101+
err = eisa_driver_register (&vortex_eisa_driver);
1102+
if (!err) {
1103+
/*
1104+
* Because of the way EISA bus is probed, we cannot assume
1105+
* any device have been found when we exit from
1106+
* eisa_driver_register (the bus root driver may not be
1107+
* initialized yet). So we blindly assume something was
1108+
* found, and let the sysfs magic happend...
1109+
*/
1110+
eisa_found = 1;
11071111
}
11081112
#endif
11091113

‎drivers/net/dgrs.c‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1551,7 +1551,7 @@ MODULE_PARM_DESC(nicmode, "Digi RightSwitch operating mode (1: switch, 2: multi-
15511551
static int __init dgrs_init_module (void)
15521552
{
15531553
int i;
1554-
int cardcount = 0;
1554+
int err;
15551555

15561556
/*
15571557
* Command line variable overrides
@@ -1593,13 +1593,13 @@ static int __init dgrs_init_module (void)
15931593
* Find and configure all the cards
15941594
*/
15951595
#ifdef CONFIG_EISA
1596-
cardcount = eisa_driver_register(&dgrs_eisa_driver);
1597-
if (cardcount < 0)
1598-
return cardcount;
1596+
err = eisa_driver_register(&dgrs_eisa_driver);
1597+
if (err)
1598+
return err;
15991599
#endif
1600-
cardcount = pci_register_driver(&dgrs_pci_driver);
1601-
if (cardcount)
1602-
return cardcount;
1600+
err = pci_register_driver(&dgrs_pci_driver);
1601+
if (err)
1602+
return err;
16031603
return 0;
16041604
}
16051605

0 commit comments

Comments
 (0)