All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] propagate pci_enable_device() errors
@ 2004-08-26 19:29 Bjorn Helgaas
       [not found] ` <412E3F93.9030503@pobox.com>
  0 siblings, 1 reply; 4+ messages in thread
From: Bjorn Helgaas @ 2004-08-26 19:29 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Jeff Garzik, ecd, chas, linux-atm-general, kkeil,
	kai.germaschewski, isdn4linux, stelian.pop, support, amax, davies,
	tulip-users, linux-kernel

Jeff Garzik pointed out that I should have propagated the error returned
from pci_enable_device() rather than making up -ENODEV.


Propagate pci_enable_device() error returns rather than using -ENODEV.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>

===== drivers/atm/idt77252.c 1.25 vs edited =====
--- 1.25/drivers/atm/idt77252.c	2004-08-24 03:08:33 -06:00
+++ edited/drivers/atm/idt77252.c	2004-08-26 13:08:03 -06:00
@@ -3684,9 +3684,9 @@
 	int i, err;
 
 
-	if (pci_enable_device(pcidev)) {
+	if ((err = pci_enable_device(pcidev))) {
 		printk("idt77252: can't enable PCI device at %s\n", pci_name(pcidev));
-		return -ENODEV;
+		return err;
 	}
 
 	if (pci_read_config_word(pcidev, PCI_REVISION_ID, &revision)) {
===== drivers/isdn/tpam/tpam_main.c 1.12 vs edited =====
--- 1.12/drivers/isdn/tpam/tpam_main.c	2004-08-24 03:08:33 -06:00
+++ edited/drivers/isdn/tpam/tpam_main.c	2004-08-26 13:09:52 -06:00
@@ -88,10 +88,10 @@
 	tpam_card *card, *c;
 	int i, err;
 
-	if (pci_enable_device(dev)) {
+	if ((err = pci_enable_device(dev))) {
 		printk(KERN_ERR "TurboPAM: can't enable PCI device at %s\n",
 			pci_name(dev));
-		return -ENODEV;
+		return err;
 	}
 
 	/* allocate memory for the board structure */
===== drivers/misc/ibmasm/module.c 1.3 vs edited =====
--- 1.3/drivers/misc/ibmasm/module.c	2004-08-24 03:08:34 -06:00
+++ edited/drivers/misc/ibmasm/module.c	2004-08-26 13:11:17 -06:00
@@ -59,13 +59,13 @@
 
 static int __init ibmasm_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
 {
-	int result = -ENOMEM;
+	int err, result = -ENOMEM;
 	struct service_processor *sp;
 
-	if (pci_enable_device(pdev)) {
+	if ((err = pci_enable_device(pdev))) {
 		printk(KERN_ERR "%s: can't enable PCI device at %s\n",
 			DRIVER_NAME, pci_name(pdev));
-		return -ENODEV;
+		return err;
 	}
 
 	sp = kmalloc(sizeof(struct service_processor), GFP_KERNEL);
===== drivers/net/tulip/de4x5.c 1.40 vs edited =====
--- 1.40/drivers/net/tulip/de4x5.c	2004-08-25 11:34:58 -06:00
+++ edited/drivers/net/tulip/de4x5.c	2004-08-26 13:13:04 -06:00
@@ -2242,8 +2242,8 @@
 		return -ENODEV;
 
 	/* Ok, the device seems to be for us. */
-	if (pci_enable_device (pdev))
-		return -ENODEV;
+	if ((error = pci_enable_device (pdev)))
+		return error;
 
 	if (!(dev = alloc_etherdev (sizeof (struct de4x5_private)))) {
 		error = -ENOMEM;

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-08-26 23:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-26 19:29 [PATCH] propagate pci_enable_device() errors Bjorn Helgaas
     [not found] ` <412E3F93.9030503@pobox.com>
2004-08-26 22:41   ` pci_disable_device kills hardware (was Re: [PATCH] propagate pci_enable_device() errors) Greg KH
2004-08-26 23:14     ` Jeff Garzik
2004-08-26 23:25       ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.