All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][RESEND] drivers/base/platform.c: Add platform_get_irq_flags()
@ 2009-03-19  8:16 Daniel Mack
  0 siblings, 0 replies; only message in thread
From: Daniel Mack @ 2009-03-19  8:16 UTC (permalink / raw)
  To: linux-kernel; +Cc: Patrick Mochel

For drivers using platform_get_irq(), a function to get the irq flags
supplied by the platform_device definition would be helpful. This patch
adds it.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Cc: Patrick Mochel <mochel@digitalimplant.org>
---
 Resending this patch with the original author of that file Cc'ed, and
 hoping that someone cares now :)

 drivers/base/platform.c         |   13 +++++++++++++
 include/linux/platform_device.h |    1 +
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 349a101..3d6a9f4 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -63,6 +63,19 @@ int platform_get_irq(struct platform_device *dev, unsigned int num)
 EXPORT_SYMBOL_GPL(platform_get_irq);
 
 /**
+ * platform_get_irq_flags - get flags of an IRQ for a device
+ * @dev: platform device
+ * @num: IRQ number index
+ */
+int platform_get_irq_flags(struct platform_device *dev, unsigned int num)
+{
+	struct resource *r = platform_get_resource(dev, IORESOURCE_IRQ, num);
+
+	return r ? r->flags : -ENXIO;
+}
+EXPORT_SYMBOL_GPL(platform_get_irq_flags);
+
+/**
  * platform_get_resource_byname - get a resource for a device by name
  * @dev: platform device
  * @type: resource type
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 9a34269..a2c6c2c 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -31,6 +31,7 @@ extern struct device platform_bus;
 
 extern struct resource *platform_get_resource(struct platform_device *, unsigned int, unsigned int);
 extern int platform_get_irq(struct platform_device *, unsigned int);
+extern int platform_get_irq_flags(struct platform_device *, unsigned int);
 extern struct resource *platform_get_resource_byname(struct platform_device *, unsigned int, char *);
 extern int platform_get_irq_byname(struct platform_device *, char *);
 extern int platform_add_devices(struct platform_device **, int);
-- 
1.6.2

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-03-19  8:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-19  8:16 [PATCH][RESEND] drivers/base/platform.c: Add platform_get_irq_flags() Daniel Mack

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.