* [PATCH] EISA: tidy-up driver_register() return value
@ 2006-03-02 23:17 Bjorn Helgaas
2006-03-03 8:00 ` Marc Zyngier
0 siblings, 1 reply; 2+ messages in thread
From: Bjorn Helgaas @ 2006-03-02 23:17 UTC (permalink / raw)
To: Marc Zyngier; +Cc: Rick Richardson, linux-kernel, Andrew Morton
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>
Index: work-mm4/drivers/eisa/eisa-bus.c
===================================================================
--- work-mm4.orig/drivers/eisa/eisa-bus.c 2006-03-01 15:37:40.000000000 -0700
+++ work-mm4/drivers/eisa/eisa-bus.c 2006-03-02 12:50:15.000000000 -0700
@@ -162,13 +162,8 @@
int eisa_driver_register (struct eisa_driver *edrv)
{
- int r;
-
edrv->driver.bus = &eisa_bus_type;
- if ((r = driver_register (&edrv->driver)) < 0)
- return r;
-
- return 0;
+ return driver_register (&edrv->driver);
}
void eisa_driver_unregister (struct eisa_driver *edrv)
Index: work-mm4/drivers/net/3c59x.c
===================================================================
--- work-mm4.orig/drivers/net/3c59x.c 2006-03-01 15:37:41.000000000 -0700
+++ work-mm4/drivers/net/3c59x.c 2006-03-02 12:52:20.000000000 -0700
@@ -1087,9 +1087,11 @@
{
int eisa_found = 0;
int orig_cards_found = vortex_cards_found;
+ int err;
#ifdef CONFIG_EISA
- if (eisa_driver_register (&vortex_eisa_driver) >= 0) {
+ err = eisa_driver_register (&vortex_eisa_driver);
+ if (!err) {
/* Because of the way EISA bus is probed, we cannot assume
* any device have been found when we exit from
* eisa_driver_register (the bus root driver may not be
Index: work-mm4/drivers/net/dgrs.c
===================================================================
--- work-mm4.orig/drivers/net/dgrs.c 2006-01-02 20:21:10.000000000 -0700
+++ work-mm4/drivers/net/dgrs.c 2006-03-02 12:54:20.000000000 -0700
@@ -1551,7 +1551,7 @@
static int __init dgrs_init_module (void)
{
int i;
- int cardcount = 0;
+ int err;
/*
* Command line variable overrides
@@ -1593,13 +1593,13 @@
* Find and configure all the cards
*/
#ifdef CONFIG_EISA
- cardcount = eisa_driver_register(&dgrs_eisa_driver);
- if (cardcount < 0)
- return cardcount;
+ err = eisa_driver_register(&dgrs_eisa_driver);
+ if (err)
+ return err;
#endif
- cardcount = pci_register_driver(&dgrs_pci_driver);
- if (cardcount)
- return cardcount;
+ err = pci_register_driver(&dgrs_pci_driver);
+ if (err)
+ return err;
return 0;
}
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] EISA: tidy-up driver_register() return value
2006-03-02 23:17 [PATCH] EISA: tidy-up driver_register() return value Bjorn Helgaas
@ 2006-03-03 8:00 ` Marc Zyngier
0 siblings, 0 replies; 2+ messages in thread
From: Marc Zyngier @ 2006-03-03 8:00 UTC (permalink / raw)
To: Bjorn Helgaas; +Cc: Rick Richardson, linux-kernel, Andrew Morton
>>>>> "Bjorn" == Bjorn Helgaas <bjorn.helgaas@hp.com> writes:
Bjorn> Remove the assumption that driver_register() returns the number
Bjorn> of devices bound to the driver. In fact, it returns zero for
Bjorn> success or a negative error value.
Bjorn> Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Looks ok to me.
Acked-by: Marc Zyngier <maz@misterjones.org>
M.
--
And if you don't know where you're going, any road will take you there...
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-03-03 8:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-02 23:17 [PATCH] EISA: tidy-up driver_register() return value Bjorn Helgaas
2006-03-03 8:00 ` Marc Zyngier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®