Commit 39e5aeed authored by Sakari Ailus's avatar Sakari Ailus Committed by Rafael J. Wysocki

device property: Constify argument to pset fwnode backend

Internally constify pset fwnode backend. Do not touch the pset fwnode
operations yet.
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 99a85464
...@@ -27,19 +27,23 @@ struct property_set { ...@@ -27,19 +27,23 @@ struct property_set {
static const struct fwnode_operations pset_fwnode_ops; static const struct fwnode_operations pset_fwnode_ops;
static inline bool is_pset_node(struct fwnode_handle *fwnode) static inline bool is_pset_node(const struct fwnode_handle *fwnode)
{ {
return !IS_ERR_OR_NULL(fwnode) && fwnode->ops == &pset_fwnode_ops; return !IS_ERR_OR_NULL(fwnode) && fwnode->ops == &pset_fwnode_ops;
} }
static inline struct property_set *to_pset_node(struct fwnode_handle *fwnode) #define to_pset_node(__fwnode) \
{ ({ \
return is_pset_node(fwnode) ? typeof(__fwnode) __to_pset_node_fwnode = __fwnode; \
container_of(fwnode, struct property_set, fwnode) : NULL; \
} is_pset_node(__to_pset_node_fwnode) ? \
container_of(__to_pset_node_fwnode, \
static const struct property_entry *pset_prop_get(struct property_set *pset, struct property_set, fwnode) : \
const char *name) NULL; \
})
static const struct property_entry *
pset_prop_get(const struct property_set *pset, const char *name)
{ {
const struct property_entry *prop; const struct property_entry *prop;
...@@ -53,7 +57,7 @@ static const struct property_entry *pset_prop_get(struct property_set *pset, ...@@ -53,7 +57,7 @@ static const struct property_entry *pset_prop_get(struct property_set *pset,
return NULL; return NULL;
} }
static const void *pset_prop_find(struct property_set *pset, static const void *pset_prop_find(const struct property_set *pset,
const char *propname, size_t length) const char *propname, size_t length)
{ {
const struct property_entry *prop; const struct property_entry *prop;
...@@ -73,7 +77,7 @@ static const void *pset_prop_find(struct property_set *pset, ...@@ -73,7 +77,7 @@ static const void *pset_prop_find(struct property_set *pset,
return pointer; return pointer;
} }
static int pset_prop_read_u8_array(struct property_set *pset, static int pset_prop_read_u8_array(const struct property_set *pset,
const char *propname, const char *propname,
u8 *values, size_t nval) u8 *values, size_t nval)
{ {
...@@ -88,7 +92,7 @@ static int pset_prop_read_u8_array(struct property_set *pset, ...@@ -88,7 +92,7 @@ static int pset_prop_read_u8_array(struct property_set *pset,
return 0; return 0;
} }
static int pset_prop_read_u16_array(struct property_set *pset, static int pset_prop_read_u16_array(const struct property_set *pset,
const char *propname, const char *propname,
u16 *values, size_t nval) u16 *values, size_t nval)
{ {
...@@ -103,7 +107,7 @@ static int pset_prop_read_u16_array(struct property_set *pset, ...@@ -103,7 +107,7 @@ static int pset_prop_read_u16_array(struct property_set *pset,
return 0; return 0;
} }
static int pset_prop_read_u32_array(struct property_set *pset, static int pset_prop_read_u32_array(const struct property_set *pset,
const char *propname, const char *propname,
u32 *values, size_t nval) u32 *values, size_t nval)
{ {
...@@ -118,7 +122,7 @@ static int pset_prop_read_u32_array(struct property_set *pset, ...@@ -118,7 +122,7 @@ static int pset_prop_read_u32_array(struct property_set *pset,
return 0; return 0;
} }
static int pset_prop_read_u64_array(struct property_set *pset, static int pset_prop_read_u64_array(const struct property_set *pset,
const char *propname, const char *propname,
u64 *values, size_t nval) u64 *values, size_t nval)
{ {
...@@ -133,7 +137,7 @@ static int pset_prop_read_u64_array(struct property_set *pset, ...@@ -133,7 +137,7 @@ static int pset_prop_read_u64_array(struct property_set *pset,
return 0; return 0;
} }
static int pset_prop_count_elems_of_size(struct property_set *pset, static int pset_prop_count_elems_of_size(const struct property_set *pset,
const char *propname, size_t length) const char *propname, size_t length)
{ {
const struct property_entry *prop; const struct property_entry *prop;
...@@ -145,7 +149,7 @@ static int pset_prop_count_elems_of_size(struct property_set *pset, ...@@ -145,7 +149,7 @@ static int pset_prop_count_elems_of_size(struct property_set *pset,
return prop->length / length; return prop->length / length;
} }
static int pset_prop_read_string_array(struct property_set *pset, static int pset_prop_read_string_array(const struct property_set *pset,
const char *propname, const char *propname,
const char **strings, size_t nval) const char **strings, size_t nval)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment