netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steve Glendinning <steve.glendinning@smsc.com>
To: linux-arm-kernel@lists.arm.linux.org.uk, netdev@vger.kernel.org
Cc: David Miller <davem@davemloft.net>,
	Russell King <linux@arm.linux.org.uk>,
	Stanley Miao <stanley.miao@windriver.com>,
	Ian Saturley <ian.saturley@smsc.com>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Steve Glendinning <steve.glendinning@smsc.com>
Subject: [PATCH 01/10] smsc911x: add support for platform-specific irq flags
Date: Tue, 27 Jan 2009 16:51:09 +0000	[thread overview]
Message-ID: <1233075077-17205-2-git-send-email-steve.glendinning@smsc.com> (raw)
In-Reply-To: <1233075077-17205-1-git-send-email-steve.glendinning@smsc.com>

this patch adds support for the platform_device's resources to indicate
additional flags to use when registering the irq, for example
IORESOURCE_IRQ_LOWLEVEL (which corresponds to IRQF_TRIGGER_LOW).  These
should be set in the irq resource flags field.

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
---
 drivers/net/smsc911x.c |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c
index f513bdf..3565df1 100644
--- a/drivers/net/smsc911x.c
+++ b/drivers/net/smsc911x.c
@@ -1892,9 +1892,9 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev)
 	struct net_device *dev;
 	struct smsc911x_data *pdata;
 	struct smsc911x_platform_config *config = pdev->dev.platform_data;
-	struct resource *res;
+	struct resource *res, *irq_res;
 	unsigned int intcfg = 0;
-	int res_size;
+	int res_size, irq_flags;
 	int retval;
 	DECLARE_MAC_BUF(mac);
 
@@ -1919,6 +1919,14 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev)
 	}
 	res_size = res->end - res->start;
 
+	irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
+	if (!irq_res) {
+		pr_warning("%s: Could not allocate irq resource.\n",
+			SMSC_CHIPNAME);
+		retval = -ENODEV;
+		goto out_0;
+	}
+
 	if (!request_mem_region(res->start, res_size, SMSC_CHIPNAME)) {
 		retval = -EBUSY;
 		goto out_0;
@@ -1935,7 +1943,8 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev)
 
 	pdata = netdev_priv(dev);
 
-	dev->irq = platform_get_irq(pdev, 0);
+	dev->irq = irq_res->start;
+	irq_flags = irq_res->flags & IRQF_TRIGGER_MASK;
 	pdata->ioaddr = ioremap_nocache(res->start, res_size);
 
 	/* copy config parameters across to pdata */
@@ -1968,8 +1977,8 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev)
 	smsc911x_reg_write(pdata, INT_EN, 0);
 	smsc911x_reg_write(pdata, INT_STS, 0xFFFFFFFF);
 
-	retval = request_irq(dev->irq, smsc911x_irqhandler, IRQF_DISABLED,
-			     dev->name, dev);
+	retval = request_irq(dev->irq, smsc911x_irqhandler,
+			     irq_flags | IRQF_DISABLED, dev->name, dev);
 	if (retval) {
 		SMSC_WARNING(PROBE,
 			"Unable to claim requested irq: %d", dev->irq);
-- 
1.6.0.6


  reply	other threads:[~2009-01-27 16:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-27 16:51 [PATCHv3 00/10] convert arm platforms to smsc911x Steve Glendinning
2009-01-27 16:51 ` Steve Glendinning [this message]
2009-01-27 16:51   ` [PATCH 02/10] smsc911x: register isr as IRQF_SHARED Steve Glendinning
2009-01-27 16:51     ` [PATCH 03/10] smsc911x: add external phy detection overrides Steve Glendinning
2009-01-27 16:51       ` [PATCH 04/10] smsc911x: allow mac address to be saved before device reset Steve Glendinning
2009-01-27 16:51         ` [PATCH 05/10] arm: convert pcm037 platform to use smsc911x Steve Glendinning
2009-01-27 16:51           ` [PATCH 06/10] arm: convert realview " Steve Glendinning
2009-01-27 16:51             ` [PATCH 07/10] arm: convert omap ldp " Steve Glendinning
2009-01-27 16:51               ` [PATCH 08/10] arm: update pcm037 defconfig " Steve Glendinning
2009-01-27 16:51                 ` [PATCH 09/10] arm: update realview defconfigs " Steve Glendinning
2009-01-27 17:54                 ` [PATCH 10/10] arm: update omap_ldp defconfig " Steve Glendinning
2009-01-27 17:19 ` [PATCHv3 00/10] convert arm platforms to smsc911x David Miller
2009-02-01  8:38 ` David Miller
2009-02-20 17:19   ` Tony Lindgren

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=1233075077-17205-2-git-send-email-steve.glendinning@smsc.com \
    --to=steve.glendinning@smsc.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=catalin.marinas@arm.com \
    --cc=davem@davemloft.net \
    --cc=ian.saturley@smsc.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux@arm.linux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=stanley.miao@windriver.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).