lkml.org 
[lkml]   [2004]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [PATCH] PCI fixes for 2.6.9
Date
From
ChangeSet 1.1997.37.60, 2004/10/06 14:07:29-07:00, greg@kroah.com

[PATCH] PCI: fix up pci_register_driver() to stop lying in its return value.

It shouldn't return 1, it needs to return either -ERROR or 0.

Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>


drivers/pci/pci-driver.c | 17 ++++++++---------
1 files changed, 8 insertions(+), 9 deletions(-)

diff -Nru a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
--- a/drivers/pci/pci-driver.c 2004-10-19 15:22:08 -07:00
+++ b/drivers/pci/pci-driver.c 2004-10-19 15:22:08 -07:00
@@ -396,13 +396,13 @@
* @drv: the driver structure to register
*
* Adds the driver structure to the list of registered drivers.
- * Returns a negative value on error. The driver remains registered
- * even if no device was claimed during registration.
+ * Returns a negative value on error, otherwise 0.
+ * If no error occured, the driver remains registered even if
+ * no device was claimed during registration.
*/
-int
-pci_register_driver(struct pci_driver *drv)
+int pci_register_driver(struct pci_driver *drv)
{
- int count = 0;
+ int error;

/* initialize common driver fields */
drv->driver.name = drv->name;
@@ -413,13 +413,12 @@
pci_init_dynids(&drv->dynids);

/* register with core */
- count = driver_register(&drv->driver);
+ error = driver_register(&drv->driver);

- if (count >= 0) {
+ if (!error)
pci_populate_driver_dir(drv);
- }

- return count ? count : 1;
+ return error;
}

/**
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:07    [W:0.719 / U:0.184 seconds]
©2003-2014 Jasper Spaans. Advertise on this site