Merge tag 'iomap-5.8-merge-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
[linux-2.6-microblaze.git] / drivers / slimbus / core.c
index 526e321..ae1e248 100644 (file)
@@ -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,
@@ -283,6 +282,7 @@ EXPORT_SYMBOL_GPL(slim_register_controller);
 /* slim_remove_device: Remove the effect of slim_add_device() */
 static void slim_remove_device(struct slim_device *sbdev)
 {
+       of_node_put(sbdev->dev.of_node);
        device_unregister(&sbdev->dev);
 }