mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bjorn.helgaas@hp.com>
To: Marc Zyngier <maz@wild-wind.fr.eu.org>
Cc: Rick Richardson <rick@remotepoint.com>,
	linux-kernel@vger.kernel.org, Andrew Morton <akpm@osdl.org>
Subject: [PATCH] EISA: tidy-up driver_register() return value
Date: Thu, 2 Mar 2006 16:17:55 -0700	[thread overview]
Message-ID: <200603021617.55396.bjorn.helgaas@hp.com> (raw)

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;
 }
 

             reply	other threads:[~2006-03-02 23:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-02 23:17 Bjorn Helgaas [this message]
2006-03-03  8:00 ` Marc Zyngier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200603021617.55396.bjorn.helgaas@hp.com \
    --to=bjorn.helgaas@hp.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@wild-wind.fr.eu.org \
    --cc=rick@remotepoint.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®