netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] drivers/net/ax88796.c: take IRQ flags from platform_device
@ 2009-03-22 16:12 Daniel Mack
  2009-03-22 16:12 ` [PATCH 2/2] ax88796: Add method to take MAC from platform data Daniel Mack
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Daniel Mack @ 2009-03-22 16:12 UTC (permalink / raw)
  To: netdev; +Cc: linux-kernel, Daniel Mack, Ben Dooks, David Miller

This patch adds support to the ax88796 ethernet driver to take IRQ flags
given by the platform_device definition.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Cc: Ben Dooks <ben@simtec.co.uk>
Cc: David Miller <davem@davemloft.net>
---
 drivers/net/ax88796.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ax88796.c b/drivers/net/ax88796.c
index a4eb6c4..e7c9748 100644
--- a/drivers/net/ax88796.c
+++ b/drivers/net/ax88796.c
@@ -93,6 +93,7 @@ struct ax_device {
 
 	unsigned char		 running;
 	unsigned char		 resume_open;
+	unsigned int		 irqflags;
 
 	u32			 reg_offsets[0x20];
 };
@@ -474,7 +475,8 @@ static int ax_open(struct net_device *dev)
 
 	dev_dbg(&ax->dev->dev, "%s: open\n", dev->name);
 
-	ret = request_irq(dev->irq, ax_ei_interrupt, 0, dev->name, dev);
+	ret = request_irq(dev->irq, ax_ei_interrupt, ax->irqflags,
+			  dev->name, dev);
 	if (ret)
 		return ret;
 
@@ -829,7 +831,7 @@ static int ax_probe(struct platform_device *pdev)
 	struct ax_device  *ax;
 	struct resource   *res;
 	size_t size;
-	int ret;
+	int ret = 0;
 
 	dev = ax__alloc_ei_netdev(sizeof(struct ax_device));
 	if (dev == NULL)
@@ -850,12 +852,14 @@ static int ax_probe(struct platform_device *pdev)
 
 	/* find the platform resources */
 
-	ret  = platform_get_irq(pdev, 0);
-	if (ret < 0) {
+	res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
+	if (res == NULL) {
 		dev_err(&pdev->dev, "no IRQ specified\n");
 		goto exit_mem;
 	}
-	dev->irq = ret;
+
+	dev->irq = res->start;
+	ax->irqflags = res->flags & IRQF_TRIGGER_MASK;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (res == NULL) {
-- 
1.6.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-03-25  6:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-22 16:12 [PATCH 1/2] drivers/net/ax88796.c: take IRQ flags from platform_device Daniel Mack
2009-03-22 16:12 ` [PATCH 2/2] ax88796: Add method to take MAC from platform data Daniel Mack
2009-03-25  6:32   ` David Miller
2009-03-22 16:18 ` [PATCH 1/2] drivers/net/ax88796.c: take IRQ flags from platform_device Daniel Mack
2009-03-25  6:31 ` David Miller

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