diff options
author | Mika Westerberg <mika.westerberg@linux.intel.com> | 2015-09-14 10:37:35 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-09-24 20:00:19 -0400 |
commit | 3f5c8d3187852b1cbed8546169e6293d6d421751 (patch) | |
tree | 72bde461108542c7afb05753288a442c80d03e4c /include/linux/property.h | |
parent | 504a33749971c36c54ba5ccb1364872dee1f17a7 (diff) |
device property: Add fwnode_property_match_string()
Sometimes it is useful to be able to extract an index of certain string
value from an array of strings. A typical use case is to give a name to a
DMA channel, PWM, clock and so on.
Provide an implementation using unified device property accessors that
follows of_property_match_string() but works for all supported fwnodes.
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/linux/property.h')
-rw-r--r-- | include/linux/property.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/property.h b/include/linux/property.h index a59c6ee566c2..463de52fe891 100644 --- a/include/linux/property.h +++ b/include/linux/property.h | |||
@@ -40,6 +40,8 @@ int device_property_read_string_array(struct device *dev, const char *propname, | |||
40 | const char **val, size_t nval); | 40 | const char **val, size_t nval); |
41 | int device_property_read_string(struct device *dev, const char *propname, | 41 | int device_property_read_string(struct device *dev, const char *propname, |
42 | const char **val); | 42 | const char **val); |
43 | int device_property_match_string(struct device *dev, | ||
44 | const char *propname, const char *string); | ||
43 | 45 | ||
44 | bool fwnode_property_present(struct fwnode_handle *fwnode, const char *propname); | 46 | bool fwnode_property_present(struct fwnode_handle *fwnode, const char *propname); |
45 | int fwnode_property_read_u8_array(struct fwnode_handle *fwnode, | 47 | int fwnode_property_read_u8_array(struct fwnode_handle *fwnode, |
@@ -59,6 +61,8 @@ int fwnode_property_read_string_array(struct fwnode_handle *fwnode, | |||
59 | size_t nval); | 61 | size_t nval); |
60 | int fwnode_property_read_string(struct fwnode_handle *fwnode, | 62 | int fwnode_property_read_string(struct fwnode_handle *fwnode, |
61 | const char *propname, const char **val); | 63 | const char *propname, const char **val); |
64 | int fwnode_property_match_string(struct fwnode_handle *fwnode, | ||
65 | const char *propname, const char *string); | ||
62 | 66 | ||
63 | struct fwnode_handle *device_get_next_child_node(struct device *dev, | 67 | struct fwnode_handle *device_get_next_child_node(struct device *dev, |
64 | struct fwnode_handle *child); | 68 | struct fwnode_handle *child); |