All of lore.kernel.org
 help / color / mirror / Atom feed
From: Don Fry <brazilnut@us.ibm.com>
To: tsbogend@alpha.franken.de, jgarzik@pobox.com, netdev@oss.sgi.com
Subject: [PATCH 2.4.28-rc2-bk3] pcnet32: added pci_disable_device
Date: Fri, 12 Nov 2004 11:41:24 -0800	[thread overview]
Message-ID: <20041112194124.GA17957@us.ibm.com> (raw)

This patch adds pci_disable_device to disable the device prior to being
removed or if the probe fails.

Tested ia32.

signed-off-by: Don Fry <brazilnut@us.ibm.com>

--- linux-2.4.28-rc2-bk3/drivers/net/orig.pcnet32.c	2004-11-12 07:45:37.000000000 -0800
+++ linux-2.4.28-rc2-bk3/drivers/net/pcnet32.c	2004-11-12 09:50:31.000000000 -0800
@@ -1007,7 +1007,11 @@ pcnet32_probe_pci(struct pci_dev *pdev, 
 	return -EBUSY;
     }
 
-    return pcnet32_probe1(ioaddr, 1, pdev);
+    err = pcnet32_probe1(ioaddr, 1, pdev);
+    if (err < 0) {
+	pci_disable_device(pdev);
+    }
+    return err;
 }
 
 
@@ -2241,6 +2245,7 @@ static void __devexit pcnet32_remove_one
 	release_region(dev->base_addr, PCNET32_TOTAL_SIZE);
 	pci_free_consistent(lp->pci_dev, sizeof(*lp), lp, lp->dma_addr);
 	free_netdev(dev);
+	pci_disable_device(pdev);
 	pci_set_drvdata(pdev, NULL);
     }
 }

-- 
Don Fry
brazilnut@us.ibm.com

             reply	other threads:[~2004-11-12 19:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-12 19:41 Don Fry [this message]
2005-01-07  3:56 ` [PATCH 2.4.28-rc2-bk3] pcnet32: added pci_disable_device Jeff Garzik

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=20041112194124.GA17957@us.ibm.com \
    --to=brazilnut@us.ibm.com \
    --cc=jgarzik@pobox.com \
    --cc=netdev@oss.sgi.com \
    --cc=tsbogend@alpha.franken.de \
    /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 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.