aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/fwnode.h
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@linux.intel.com>2017-07-21 07:39:31 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-07-21 18:04:50 -0400
commitdb3e50f3234ba1a477413f56a9e5800a73dca786 (patch)
tree87c3c735dd51f68e77d3189186094ee216204a76 /include/linux/fwnode.h
parentb81b729164445cd94c4dd6fc4d6f10487434df4a (diff)
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/fwnode.h')
-rw-r--r--include/linux/fwnode.h11
1 files changed, 0 insertions, 11 deletions
diff --git a/include/linux/fwnode.h b/include/linux/fwnode.h
index 50893a1646cf..c5dbc48b55dd 100644
--- a/include/linux/fwnode.h
+++ b/include/linux/fwnode.h
@@ -14,20 +14,9 @@
14 14
15#include <linux/types.h> 15#include <linux/types.h>
16 16
17enum fwnode_type {
18 FWNODE_INVALID = 0,
19 FWNODE_OF,
20 FWNODE_ACPI,
21 FWNODE_ACPI_DATA,
22 FWNODE_ACPI_STATIC,
23 FWNODE_PDATA,
24 FWNODE_IRQCHIP
25};
26
27struct fwnode_operations; 17struct fwnode_operations;
28 18
29struct fwnode_handle { 19struct fwnode_handle {
30 enum fwnode_type type;
31 struct fwnode_handle *secondary; 20 struct fwnode_handle *secondary;
32 const struct fwnode_operations *ops; 21 const struct fwnode_operations *ops;
33}; 22};