From: Francois Romieu <romieu@cogenit.fr>
To: Jeff Garzik <jgarzik@mandrakesoft.com>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] 2.5.24 - drivers/net/tlan.c dma mapping 1/10
Date: Sun, 30 Jun 2002 17:18:52 +0200 [thread overview]
Message-ID: <20020630171852.C19347@fafner.intra.cogenit.fr> (raw)
In-Reply-To: <3D17743E.8060905@mandrakesoft.com>; from jgarzik@mandrakesoft.com on Mon, Jun 24, 2002 at 03:34:22PM -0400
- removal of code duplication.
--- linux-2.5.24/drivers/net/tlan.c Sat Jun 29 21:59:16 2002
+++ linux-2.5.24/drivers/net/tlan.c Sat Jun 29 22:01:37 2002
@@ -295,6 +295,7 @@ static int TLan_ioctl( struct net_device
static int TLan_probe1( struct pci_dev *pdev, long ioaddr, int irq, int rev, const struct pci_device_id *ent);
static void TLan_tx_timeout( struct net_device *dev);
static int tlan_init_one( struct pci_dev *pdev, const struct pci_device_id *ent);
+static void TLan_Release_Dev(struct net_device *);
static u32 TLan_HandleInvalid( struct net_device *, u16 );
static u32 TLan_HandleTxEOF( struct net_device *, u16 );
@@ -415,18 +416,8 @@ TLan_SetTimer( struct net_device *dev, u
static void __devexit tlan_remove_one( struct pci_dev *pdev)
{
struct net_device *dev = pci_get_drvdata( pdev );
- TLanPrivateInfo *priv = dev->priv;
-
- unregister_netdev( dev );
-
- if ( priv->dmaStorage ) {
- kfree( priv->dmaStorage );
- }
-
- release_region( dev->base_addr, 0x10 );
-
- kfree( dev );
+ TLan_Release_Dev(dev);
pci_set_drvdata( pdev, NULL );
}
@@ -627,23 +618,25 @@ static int __devinit TLan_probe1(struct
}
+static void TLan_Release_Dev(struct net_device *dev)
+{
+ TLanPrivateInfo *priv = dev->priv;
+
+ if (priv->dmaStorage)
+ kfree(priv->dmaStorage);
+ release_region(dev->base_addr, 0x10);
+ unregister_netdev(dev);
+}
static void TLan_Eisa_Cleanup(void)
{
- struct net_device *dev;
- TLanPrivateInfo *priv;
+ for (; tlan_have_eisa; tlan_have_eisa--) {
+ struct net_device *dev = TLan_Eisa_Devices;
+ TLanPrivateInfo *priv = dev->priv;
- while( tlan_have_eisa ) {
- dev = TLan_Eisa_Devices;
- priv = dev->priv;
- if (priv->dmaStorage) {
- kfree(priv->dmaStorage);
- }
- release_region( dev->base_addr, 0x10);
- unregister_netdev( dev );
+ TLan_Release_Dev(dev);
TLan_Eisa_Devices = priv->nextDevice;
kfree( dev );
- tlan_have_eisa--;
}
}
next prev parent reply other threads:[~2002-06-30 15:16 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-06-24 2:34 [PATCH] 2.5.24 : drivers/net/tlan.c Frank Davis
2002-06-24 6:43 ` Francois Romieu
2002-06-24 19:14 ` [PATCH] 2.5.24 : drivers/net/tlan.c; drivers/net/rrunner.c Francois Romieu
2002-06-24 19:34 ` Jeff Garzik
2002-06-24 20:59 ` Dave Jones
2002-06-30 15:18 ` [PATCH] 2.5.24 - drivers/net/tlan.c dma mapping 0/10 Francois Romieu
2002-06-30 15:18 ` Francois Romieu [this message]
2002-06-30 15:19 ` [PATCH] 2.5.24 - drivers/net/tlan.c dma mapping 2/10 Francois Romieu
2002-06-30 15:19 ` [PATCH] 2.5.24 - drivers/net/tlan.c dma mapping 3/10 Francois Romieu
2002-06-30 15:19 ` [PATCH] 2.5.24 - drivers/net/tlan.c dma mapping 4/10 Francois Romieu
2002-06-30 15:19 ` [PATCH] 2.5.24 - drivers/net/tlan.c dma mapping 5/10 Francois Romieu
2002-06-30 15:19 ` [PATCH] 2.5.24 - drivers/net/tlan.c dma mapping 6/10 Francois Romieu
2002-06-30 15:19 ` [PATCH] 2.5.24 - drivers/net/tlan.c dma mapping 7/10 Francois Romieu
2002-06-30 15:19 ` [PATCH] 2.5.24 - drivers/net/tlan.c dma mapping 8/10 Francois Romieu
2002-06-30 15:20 ` [PATCH] 2.5.24 - drivers/net/tlan.c dma mapping 9/10 Francois Romieu
2002-06-30 15:20 ` [PATCH] 2.5.24 - drivers/net/tlan.c dma mapping 10/10 Francois Romieu
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=20020630171852.C19347@fafner.intra.cogenit.fr \
--to=romieu@cogenit.fr \
--cc=jgarzik@mandrakesoft.com \
--cc=linux-kernel@vger.kernel.org \
/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®