@@ -14,34 +14,6 @@
#include <linux/property.h>
#include <linux/slab.h>
-struct property_set {
- struct device *dev;
- struct fwnode_handle fwnode;
- const struct property_entry *properties;
-
- struct property_set *parent;
- /* Entry in parent->children list */
- struct list_head child_node;
- struct list_head children;
-};
-
-static const struct fwnode_operations pset_fwnode_ops;
-
-static inline bool is_pset_node(const struct fwnode_handle *fwnode)
-{
- return !IS_ERR_OR_NULL(fwnode) && fwnode->ops == &pset_fwnode_ops;
-}
-
-#define to_pset_node(__fwnode) \
- ({ \
- typeof(__fwnode) __to_pset_node_fwnode = __fwnode; \
- \
- is_pset_node(__to_pset_node_fwnode) ? \
- container_of(__to_pset_node_fwnode, \
- struct property_set, fwnode) : \
- NULL; \
- })
-
static const struct property_entry *
pset_prop_get(const struct property_set *pset, const char *name)
{
@@ -323,13 +295,14 @@ pset_fwnode_get_next_subnode(const struct fwnode_handle *fwnode,
return &next->fwnode;
}
-static const struct fwnode_operations pset_fwnode_ops = {
+const struct fwnode_operations pset_fwnode_ops = {
.property_present = pset_fwnode_property_present,
.property_read_int_array = pset_fwnode_read_int_array,
.property_read_string_array = pset_fwnode_property_read_string_array,
.get_parent = pset_fwnode_get_parent,
.get_next_child_node = pset_fwnode_get_next_subnode,
};
+EXPORT_SYMBOL_GPL(pset_fwnode_ops);
static void property_entry_free_data(const struct property_entry *p)
{
@@ -13,6 +13,7 @@
#ifndef _LINUX_PROPERTY_H_
#define _LINUX_PROPERTY_H_
+#include <linux/err.h>
#include <linux/fwnode.h>
#include <linux/types.h>
@@ -281,6 +282,34 @@ device_add_child_properties(struct device *dev,
const struct property_entry *properties);
void device_remove_properties(struct device *dev);
+struct property_set {
+ struct device *dev;
+ struct fwnode_handle fwnode;
+ const struct property_entry *properties;
+
+ struct property_set *parent;
+ /* Entry in parent->children list */
+ struct list_head child_node;
+ struct list_head children;
+};
+
+extern const struct fwnode_operations pset_fwnode_ops;
+
+static inline bool is_pset_node(const struct fwnode_handle *fwnode)
+{
+ return !IS_ERR_OR_NULL(fwnode) && fwnode->ops == &pset_fwnode_ops;
+}
+
+#define to_pset_node(__fwnode) \
+ ({ \
+ typeof(__fwnode) __to_pset_node_fwnode = __fwnode; \
+ \
+ is_pset_node(__to_pset_node_fwnode) ? \
+ container_of(__to_pset_node_fwnode, \
+ struct property_set, fwnode) : \
+ NULL; \
+ })
+
bool device_dma_supported(struct device *dev);
enum dev_dma_attr device_get_dma_attr(struct device *dev);
Future gpiolib will need to handle property sets properly, and this we need to export property_set, is_pset_node() and to_pset_node(). Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> --- drivers/base/pset_property.c | 31 ++----------------------------- include/linux/property.h | 29 +++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 29 deletions(-)