]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mfd: core: Make use of device_set_node()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 30 May 2024 11:51:47 +0000 (14:51 +0300)
committerLee Jones <lee@kernel.org>
Thu, 4 Jul 2024 16:08:03 +0000 (17:08 +0100)
Use device_set_node() instead of assigning pdev->dev.of_node
directly because it also sets the firmware node.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Herve Codina <herve.codina@bootlin.com>
Link: https://lore.kernel.org/r/20240530115147.1112498-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/mfd/mfd-core.c

index 6ad5c93027afc66a9155612d8704b50beace1977..7ea9a875d8f310ad05c2cdce0fda0fc60c4dbcde 100644 (file)
@@ -87,7 +87,7 @@ static void mfd_acpi_add_device(const struct mfd_cell *cell,
                }
        }
 
-       ACPI_COMPANION_SET(&pdev->dev, adev ?: parent);
+       device_set_node(&pdev->dev, acpi_fwnode_handle(adev ?: parent));
 }
 #else
 static inline void mfd_acpi_add_device(const struct mfd_cell *cell,
@@ -131,8 +131,7 @@ allocate_of_node:
        of_entry->np = np;
        list_add_tail(&of_entry->list, &mfd_of_node_list);
 
-       pdev->dev.of_node = np;
-       pdev->dev.fwnode = &np->fwnode;
+       device_set_node(&pdev->dev, of_fwnode_handle(np));
 #endif
        return 0;
 }