Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1286974
| From | Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v5 2/5] irqdomain: introduce is_fwnode_irqchip helper |
| Date | 2015-12-09 03:00 +0100 |
| Message-ID | <qDCcV-1JL-1@gated-at.bofh.it> (permalink) |
| References | <qDC3f-1Gd-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Since there will be several places checking if fwnode.type
is equal FWNODE_IRQCHIP, this patch adds a convenient function
for this purpose.
Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
---
drivers/irqchip/irq-gic.c | 2 +-
include/linux/irqdomain.h | 5 +++++
kernel/irq/irqdomain.c | 2 +-
3 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
index abf2ffa..fcd327f 100644
--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
@@ -972,7 +972,7 @@ static int gic_irq_domain_translate(struct irq_domain *d,
return 0;
}
- if (fwspec->fwnode->type == FWNODE_IRQCHIP) {
+ if (is_fwnode_irqchip(fwspec->fwnode)) {
if(fwspec->param_count != 2)
return -EINVAL;
diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index a06feda..d72fabc 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -211,6 +211,11 @@ static inline struct fwnode_handle *of_node_to_fwnode(struct device_node *node)
return node ? &node->fwnode : NULL;
}
+static inline bool is_fwnode_irqchip(struct fwnode_handle *fwnode)
+{
+ return fwnode && fwnode->type == FWNODE_IRQCHIP;
+}
+
static inline struct irq_domain *irq_find_matching_host(struct device_node *node,
enum irq_domain_bus_token bus_token)
{
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 22aa961..7f34d98 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -70,7 +70,7 @@ void irq_domain_free_fwnode(struct fwnode_handle *fwnode)
{
struct irqchip_fwid *fwid;
- if (WARN_ON(fwnode->type != FWNODE_IRQCHIP))
+ if (WARN_ON(!is_fwnode_irqchip(fwnode)))
return;
fwid = container_of(fwnode, struct irqchip_fwid, fwnode);
--
2.1.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v5 0/5] gicv2m: acpi: Add ACPI support for GICv2m MSI Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> - 2015-12-09 02:50 +0100
[PATCH v5 2/5] irqdomain: introduce is_fwnode_irqchip helper Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> - 2015-12-09 03:00 +0100
Re: [PATCH v5 2/5] irqdomain: introduce is_fwnode_irqchip helper Marc Zyngier <marc.zyngier@arm.com> - 2015-12-09 11:20 +0100
[PATCH v5 3/5] irqdomain: Introduce irq_domain_get_irqchip_fwnode_name helper function Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> - 2015-12-09 03:00 +0100
[PATCH v5 4/5] gicv2m: Refactor to prepare for ACPI support Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> - 2015-12-09 03:00 +0100
Re: [PATCH v5 4/5] gicv2m: Refactor to prepare for ACPI support Marc Zyngier <marc.zyngier@arm.com> - 2015-12-09 11:30 +0100
csiph-web