diff options
author | Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> | 2015-12-10 11:55:28 -0500 |
---|---|---|
committer | Marc Zyngier <marc.zyngier@arm.com> | 2015-12-21 08:49:49 -0500 |
commit | 75aba7b0e9ac416ca53c0c97680b8e9aedf09284 (patch) | |
tree | e7a35ae62453184a1ed1fd43f329ea3379e09563 | |
parent | 471036b2b895789c2305428fd879006468e4a758 (diff) |
irqdomain: Introduce is_fwnode_irqchip helper
Since there will be several places checking if fwnode.type
is equal FWNODE_IRQCHIP, this patch adds a convenient function
for this purpose.
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
-rw-r--r-- | drivers/irqchip/irq-gic.c | 2 | ||||
-rw-r--r-- | include/linux/irqdomain.h | 5 | ||||
-rw-r--r-- | 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 abf2ffaed392..fcd327f49e8e 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, | |||
972 | return 0; | 972 | return 0; |
973 | } | 973 | } |
974 | 974 | ||
975 | if (fwspec->fwnode->type == FWNODE_IRQCHIP) { | 975 | if (is_fwnode_irqchip(fwspec->fwnode)) { |
976 | if(fwspec->param_count != 2) | 976 | if(fwspec->param_count != 2) |
977 | return -EINVAL; | 977 | return -EINVAL; |
978 | 978 | ||
diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h index a06fedacd955..d72fabc04437 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) | |||
211 | return node ? &node->fwnode : NULL; | 211 | return node ? &node->fwnode : NULL; |
212 | } | 212 | } |
213 | 213 | ||
214 | static inline bool is_fwnode_irqchip(struct fwnode_handle *fwnode) | ||
215 | { | ||
216 | return fwnode && fwnode->type == FWNODE_IRQCHIP; | ||
217 | } | ||
218 | |||
214 | static inline struct irq_domain *irq_find_matching_host(struct device_node *node, | 219 | static inline struct irq_domain *irq_find_matching_host(struct device_node *node, |
215 | enum irq_domain_bus_token bus_token) | 220 | enum irq_domain_bus_token bus_token) |
216 | { | 221 | { |
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index 22aa9612ef7c..7f34d98ebfc4 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c | |||
@@ -70,7 +70,7 @@ void irq_domain_free_fwnode(struct fwnode_handle *fwnode) | |||
70 | { | 70 | { |
71 | struct irqchip_fwid *fwid; | 71 | struct irqchip_fwid *fwid; |
72 | 72 | ||
73 | if (WARN_ON(fwnode->type != FWNODE_IRQCHIP)) | 73 | if (WARN_ON(!is_fwnode_irqchip(fwnode))) |
74 | return; | 74 | return; |
75 | 75 | ||
76 | fwid = container_of(fwnode, struct irqchip_fwid, fwnode); | 76 | fwid = container_of(fwnode, struct irqchip_fwid, fwnode); |