netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michal Rokos <michal@rokos.info>
To: Linux Netdev List <netdev@oss.sgi.com>
Cc: linux-kernel@vger.kernel.org
Subject: [Patch 2.6] Natsemi -  add missing pci_disable_device() call
Date: Thu, 21 Oct 2004 12:44:37 +0200	[thread overview]
Message-ID: <41779315.7080306@rokos.info> (raw)

Hello,

natsemi doesn't call pci_disable_device() during exit or error in init.

So this patch does it.

	Michal

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/10/21 10:56:57+02:00 michal@rokos.ack-prg.csas.cz
#   [NATSEMI] Add missing pci_disable_device().
#
# drivers/net/natsemi.c
#   2004/10/21 10:56:45+02:00 michal@rokos.ack-prg.csas.cz +9 -3
#   Add missing pci_disable_device().
#
diff -Nru a/drivers/net/natsemi.c b/drivers/net/natsemi.c
--- a/drivers/net/natsemi.c	2004-10-21 10:58:06 +02:00
+++ b/drivers/net/natsemi.c	2004-10-21 10:58:06 +02:00
@@ -821,7 +821,7 @@
  #endif

  	i = pci_enable_device(pdev);
-	if (i) return i;
+	if (i) goto out;

  	/* natsemi has a non-standard PM control register
  	 * in PCI config space.  Some boards apparently need
@@ -843,8 +843,10 @@
  		pci_set_master(pdev);

  	dev = alloc_etherdev(sizeof (struct netdev_private));
-	if (!dev)
-		return -ENOMEM;
+	if (!dev) {
+		i = -ENOMEM;
+		goto err_alloc_etherdev;
+	}
  	SET_MODULE_OWNER(dev);
  	SET_NETDEV_DEV(dev, &pdev->dev);

@@ -1001,6 +1003,9 @@

   err_pci_request_regions:
  	free_netdev(dev);
+ err_alloc_etherdev:
+	pci_disable_device(pdev);
+ out:
  	return i;
  }

@@ -3133,6 +3138,7 @@
  	iounmap(ioaddr);
  	free_netdev (dev);
  	pci_set_drvdata(pdev, NULL);
+	pci_disable_device(pdev);
  }

  #ifdef CONFIG_PM

                 reply	other threads:[~2004-10-21 10:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=41779315.7080306@rokos.info \
    --to=michal@rokos.info \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@oss.sgi.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;
as well as URLs for NNTP newsgroup(s).