aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/fwnode.h
diff options
context:
space:
mode:
authorSaravana Kannan <saravanak@google.com>2020-11-20 18:02:22 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-12-09 19:10:20 +0100
commit01bb86b380a306bd937c96da36f66429f3362137 (patch)
treec2704de4852ab4a3d08db6b027b59ac137a70f3d /include/linux/fwnode.h
parentRevert "driver core: fw_devlink: Add support for batching fwnode parsing" (diff)
downloadlinux-dev-01bb86b380a306bd937c96da36f66429f3362137.tar.xz
linux-dev-01bb86b380a306bd937c96da36f66429f3362137.zip
driver core: Add fwnode_init()
There are multiple locations in the kernel where a struct fwnode_handle is initialized. Add fwnode_init() so that we have one way of initializing a fwnode_handle. Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Saravana Kannan <saravanak@google.com> Link: https://lore.kernel.org/r/20201121020232.908850-8-saravanak@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/fwnode.h')
-rw-r--r--include/linux/fwnode.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/fwnode.h b/include/linux/fwnode.h
index e0abafbb17f8..5589799708b5 100644
--- a/include/linux/fwnode.h
+++ b/include/linux/fwnode.h
@@ -170,6 +170,12 @@ struct fwnode_operations {
} while (false)
#define get_dev_from_fwnode(fwnode) get_device((fwnode)->dev)
+static inline void fwnode_init(struct fwnode_handle *fwnode,
+ const struct fwnode_operations *ops)
+{
+ fwnode->ops = ops;
+}
+
extern u32 fw_devlink_get_flags(void);
#endif