mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Francois Romieu <romieu@fr.zoreil.com>
To: Mark Einon <mark.einon@gmail.com>
Cc: Greg KH <greg@kroah.com>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: [PATCH staging 5/6] et131x: kiss netdev.{base_addr, irq} goodbye.
Date: Sun, 23 Oct 2011 19:12:01 +0200	[thread overview]
Message-ID: <20111023171201.GE28657@electric-eye.fr.zoreil.com> (raw)
In-Reply-To: <20111023094231.GA3409@msilap.einon>

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
---
 drivers/staging/et131x/et131x.c |   17 ++++++-----------
 1 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/et131x/et131x.c b/drivers/staging/et131x/et131x.c
index 46de73b..79ca1d3 100644
--- a/drivers/staging/et131x/et131x.c
+++ b/drivers/staging/et131x/et131x.c
@@ -4366,10 +4366,6 @@ static struct et131x_adapter *et131x_adapter_init(struct net_device *netdev,
 	adapter->pdev = pci_dev_get(pdev);
 	adapter->netdev = netdev;
 
-	/* Do the same for the netdev struct */
-	netdev->irq = pdev->irq;
-	netdev->base_addr = pci_resource_start(pdev, 0);
-
 	/* Initialize spinlocks here */
 	spin_lock_init(&adapter->lock);
 	spin_lock_init(&adapter->tcb_send_qlock);
@@ -4828,8 +4824,10 @@ static struct net_device_stats *et131x_stats(struct net_device *netdev)
  */
 static int et131x_open(struct net_device *netdev)
 {
-	int result = 0;
 	struct et131x_adapter *adapter = netdev_priv(netdev);
+	struct pci_dev *pdev = adapter->pdev;
+	unsigned int irq = pdev->irq;
+	int result;
 
 	/* Start the timer to track NIC errors */
 	init_timer(&adapter->error_timer);
@@ -4838,12 +4836,9 @@ static int et131x_open(struct net_device *netdev)
 	adapter->error_timer.data = (unsigned long)adapter;
 	add_timer(&adapter->error_timer);
 
-	/* Register our IRQ */
-	result = request_irq(netdev->irq, et131x_isr, IRQF_SHARED,
-					netdev->name, netdev);
+	result = request_irq(irq, et131x_isr, IRQF_SHARED, netdev->name, netdev);
 	if (result) {
-		dev_err(&adapter->pdev->dev, "could not register IRQ %d\n",
-			netdev->irq);
+		dev_err(&pdev->dev, "could not register IRQ %d\n", irq);
 		return result;
 	}
 
@@ -4867,7 +4862,7 @@ static int et131x_close(struct net_device *netdev)
 	et131x_down(netdev);
 
 	adapter->flags &= ~fMP_ADAPTER_INTERRUPT_IN_USE;
-	free_irq(netdev->irq, netdev);
+	free_irq(adapter->pdev->irq, netdev);
 
 	/* Stop the error timer */
 	return del_timer_sync(&adapter->error_timer);
-- 
1.7.6.4


  parent reply	other threads:[~2011-10-23 17:15 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-23  9:22 [PATCH 00/12 RESEND] Mainly checkpatch fixes Mark Einon
2011-10-23  9:22 ` [PATCH 01/12] staging: et131x: Remove unused rx_ring.recv_buffer_pool Mark Einon
2011-10-23  9:22 ` [PATCH 02/12] staging: et131x: Remove redundant et131x_reset_recv() call Mark Einon
2011-10-23  9:22 ` [PATCH 03/12] staging: et131x: Remove call to find pci pm capability Mark Einon
2011-10-23  9:22 ` [PATCH 04/12] staging: et131x: Remove unused rx_ring.recv_packet_pool Mark Einon
2011-10-23  9:22 ` [PATCH 05/12] staging: et131x: Remove some forward declarations Mark Einon
2011-10-23  9:22 ` [PATCH 06/12] staging: et131x: Remove forward declaration of et131x_adapter_setup Mark Einon
2011-10-23  9:22 ` [PATCH 07/12] staging: et131x: Remove more forward declarations Mark Einon
2011-10-23  9:22 ` [PATCH 08/12] staging: et131x: Remove yet " Mark Einon
2011-10-23  9:22 ` [PATCH 09/12] staging: et131x: Remove even " Mark Einon
2011-10-23  9:22 ` [PATCH 10/12] staging: et131x: Remove last of the " Mark Einon
2011-10-23  9:22 ` [PATCH 11/12] staging: et131x: Mainly whitespace changes to appease checkpatch Mark Einon
2011-10-23  9:22 ` [PATCH 12/12] staging: et131x: Remove redundant check and return statement Mark Einon
2011-10-23  9:36 ` [PATCH 00/12 RESEND] Mainly checkpatch fixes Greg KH
2011-10-23  9:42   ` Mark Einon
2011-10-23 17:11     ` [PATCH staging 1/6] et131x: add static qualifiers Francois Romieu
2011-10-24 20:34       ` Mark Einon
2011-10-23 17:11     ` [PATCH staging 2/6] et131x: uintxy_t removal Francois Romieu
2011-10-24 20:33       ` Mark Einon
2011-10-25 15:58         ` Francois Romieu
2011-10-23 17:11     ` [PATCH staging 3/6] et131x: fix error paths in et131x_pci_setup Francois Romieu
2011-10-24 20:21       ` Mark Einon
2011-10-25 15:59         ` Francois Romieu
2011-10-25 17:53       ` Mark Einon
2011-10-23 17:11     ` [PATCH staging 4/6] et131x: remove extraneous pci_save_state Francois Romieu
2011-10-24 20:17       ` Mark Einon
2011-10-23 17:12     ` Francois Romieu [this message]
2011-10-24 20:16       ` [PATCH staging 5/6] et131x: kiss netdev.{base_addr, irq} goodbye Mark Einon
2011-10-23 17:12     ` [PATCH staging 6/6] et131x: uncloak PCIe capabilities Francois Romieu
2011-10-24 19:56       ` Mark Einon
2011-10-25 15:59         ` Francois Romieu
2011-10-25 17:42           ` Mark Einon
2011-10-25 17:54       ` Mark Einon

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=20111023171201.GE28657@electric-eye.fr.zoreil.com \
    --to=romieu@fr.zoreil.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.einon@gmail.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

all inboxes | Powered by JetHome®