netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch 2.6] Natsemi -  add missing pci_disable_device() call
@ 2004-10-21 10:44 Michal Rokos
  0 siblings, 0 replies; only message in thread
From: Michal Rokos @ 2004-10-21 10:44 UTC (permalink / raw)
  To: Linux Netdev List; +Cc: linux-kernel

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-10-21 10:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-21 10:44 [Patch 2.6] Natsemi - add missing pci_disable_device() call Michal Rokos

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).