All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] sparc: Add sparc support for platform_get_irq()
@ 2012-10-18  7:42 Andreas Larsson
  2012-10-23 10:16 ` Andreas Larsson
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Andreas Larsson @ 2012-10-18  7:42 UTC (permalink / raw)
  To: sparclinux

This adds sparc support for platform_get_irq that in the normal case use
platform_get_resource() to get an irq. This standard approach fails for sparc as
there are no resources of type IORESOURCE_IRQ for irqs for sparc.

Cross platform drivers can then use this standard platform function and work on
sparc instead of having to have a special case for sparc.

Signed-off-by: Andreas Larsson <andreas@gaisler.com>
---
 drivers/base/platform.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index ddeca14..a17199a 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -82,9 +82,15 @@ EXPORT_SYMBOL_GPL(platform_get_resource);
  */
 int platform_get_irq(struct platform_device *dev, unsigned int num)
 {
+#ifdef CONFIG_SPARC
+	if (!dev || num >= dev->archdata.num_irqs)
+		return -ENXIO;
+	return dev->archdata.irqs[num];
+#else
 	struct resource *r = platform_get_resource(dev, IORESOURCE_IRQ, num);
 
 	return r ? r->start : -ENXIO;
+#endif
 }
 EXPORT_SYMBOL_GPL(platform_get_irq);
 
-- 
1.7.0.4


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

end of thread, other threads:[~2012-11-10  3:48 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-18  7:42 [PATCH v2] sparc: Add sparc support for platform_get_irq() Andreas Larsson
2012-10-23 10:16 ` Andreas Larsson
2012-10-23 17:10 ` David Miller
2012-10-24 19:37 ` Sam Ravnborg
2012-10-24 19:57 ` David Miller
2012-10-25 11:57 ` andreas
2012-10-30  9:26   ` [PATCH v3] " Andreas Larsson
2012-10-30  9:26     ` Andreas Larsson
2012-11-10  3:48 ` [PATCH v2] " David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.