summaryrefslogtreecommitdiffstats
path: root/drivers/slimbus/core.c
diff options
context:
space:
mode:
authorSaravana Kannan <saravanak@google.com>2020-05-11 16:13:33 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-05-15 16:21:07 +0200
commitdbf4d13382be7b272417025f5f6687641eb7dd21 (patch)
treee3420531c28e96b32cf67ad596a6bdfb05e1a99b /drivers/slimbus/core.c
parente270df39f728fd47771613f1147b26a600d183e8 (diff)
downloadlinux-dbf4d13382be7b272417025f5f6687641eb7dd21.tar.bz2
slimbus: core: Set fwnode for a device when setting of_node
When setting the of_node for a newly created device, also set the fwnode. This allows fw_devlink feature to work for slimbus devices. Also, remove some unnecessary NULL checks. The functions in question already do NULL checks. Signed-off-by: Saravana Kannan <saravanak@google.com> [Srini: removed unnecessary NULL check from other patch] Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20200511151334.362-2-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/slimbus/core.c')
-rw-r--r--drivers/slimbus/core.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/slimbus/core.c b/drivers/slimbus/core.c
index 526e3215d8fe..1f3beee74fdf 100644
--- a/drivers/slimbus/core.c
+++ b/drivers/slimbus/core.c
@@ -162,9 +162,8 @@ static int slim_add_device(struct slim_controller *ctrl,
sbdev->ctrl = ctrl;
INIT_LIST_HEAD(&sbdev->stream_list);
spin_lock_init(&sbdev->stream_list_lock);
-
- if (node)
- sbdev->dev.of_node = of_node_get(node);
+ sbdev->dev.of_node = of_node_get(node);
+ sbdev->dev.fwnode = of_fwnode_handle(node);
dev_set_name(&sbdev->dev, "%x:%x:%x:%x",
sbdev->e_addr.manf_id,