aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/irqdomain.h
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@linux.intel.com>2017-07-21 14:39:31 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-07-22 00:04:50 +0200
commitdb3e50f3234ba1a477413f56a9e5800a73dca786 (patch)
tree87c3c735dd51f68e77d3189186094ee216204a76 /include/linux/irqdomain.h
parentACPI: Use IS_ERR_OR_NULL() instead of non-NULL check in is_acpi_data_node() (diff)
downloadlinux-dev-db3e50f3234ba1a477413f56a9e5800a73dca786.tar.xz
linux-dev-db3e50f3234ba1a477413f56a9e5800a73dca786.zip
device property: Get rid of struct fwnode_handle type field
Instead of relying on the struct fwnode_handle type field, define fwnode_operations structs for all separate types of fwnodes. To find out the type, compare to the ops field to relevant ops structs. This change has two benefits: 1. it avoids adding the type field to each and every instance of struct fwnode_handle, thus saving memory and 2. makes the ops field the single factor that defines both the types of the fwnode as well as defines the implementation of its operations, decreasing the possibility of bugs when developing code dealing with fwnode internals. Suggested-by: Rob Herring <robh@kernel.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/linux/irqdomain.h')
-rw-r--r--include/linux/irqdomain.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index cac77a5c5555..d24273840b79 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -265,9 +265,11 @@ static inline struct fwnode_handle *of_node_to_fwnode(struct device_node *node)
return node ? &node->fwnode : NULL;
}
+extern const struct fwnode_operations irqchip_fwnode_ops;
+
static inline bool is_fwnode_irqchip(struct fwnode_handle *fwnode)
{
- return fwnode && fwnode->type == FWNODE_IRQCHIP;
+ return fwnode && fwnode->ops == &irqchip_fwnode_ops;
}
extern void irq_domain_update_bus_token(struct irq_domain *domain,