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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <[email protected]>

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;
 }
 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux