From: Bjorn Helgaas <bjorn.helgaas@hp.com>
To: Andrew Morton <akpm@osdl.org>
Cc: Jeff Garzik <jgarzik@pobox.com>,
ecd@atecom.com, chas@cmf.nrl.navy.mil,
linux-atm-general@lists.sourceforge.net, kkeil@suse.de,
kai.germaschewski@gmx.de, isdn4linux@listserv.isdn4linux.de,
stelian.pop@fr.alcove.com, support@auvertech.fr, amax@us.ibm.com,
davies@maniac.ultranet.com, tulip-users@lists.sourceforge.net,
linux-kernel@vger.kernel.org
Subject: [PATCH] propagate pci_enable_device() errors
Date: Thu, 26 Aug 2004 13:29:16 -0600 [thread overview]
Message-ID: <200408261329.16825.bjorn.helgaas@hp.com> (raw)
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;
next reply other threads:[~2004-08-26 19:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-26 19:29 Bjorn Helgaas [this message]
[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
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=200408261329.16825.bjorn.helgaas@hp.com \
--to=bjorn.helgaas@hp.com \
--cc=akpm@osdl.org \
--cc=amax@us.ibm.com \
--cc=chas@cmf.nrl.navy.mil \
--cc=davies@maniac.ultranet.com \
--cc=ecd@atecom.com \
--cc=isdn4linux@listserv.isdn4linux.de \
--cc=jgarzik@pobox.com \
--cc=kai.germaschewski@gmx.de \
--cc=kkeil@suse.de \
--cc=linux-atm-general@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=stelian.pop@fr.alcove.com \
--cc=support@auvertech.fr \
--cc=tulip-users@lists.sourceforge.net \
/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®