diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2023-06-15 16:52:43 +0200 |
---|---|---|
committer | Rob Herring <robh@kernel.org> | 2023-06-15 18:48:19 +0200 |
commit | 0f8e5651095bcf6e60330c8d558fd1227e0d71b3 (patch) | |
tree | 15e76a8c70e66238eb0838776b53e2769032fab7 /drivers/of/platform.c | |
parent | dt-bindings: eeprom: at25: add st,m95640 compatible (diff) | |
download | linux-0f8e5651095bcf6e60330c8d558fd1227e0d71b3.tar.xz linux-0f8e5651095bcf6e60330c8d558fd1227e0d71b3.zip |
of/platform: Propagate firmware node by calling device_set_node()
Insulate of_device_alloc() and of_amba_device_create() from possible
changes to fwnode_handle implementation by using device_set_node()
instead of open-coding dev->dev.fwnode assignments.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230615145243.37095-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'drivers/of/platform.c')
-rw-r--r-- | drivers/of/platform.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/of/platform.c b/drivers/of/platform.c index 78ae84187449..051e29b7ad2b 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -140,8 +140,8 @@ struct platform_device *of_device_alloc(struct device_node *np, } } - dev->dev.of_node = of_node_get(np); - dev->dev.fwnode = &np->fwnode; + /* setup generic device info */ + device_set_node(&dev->dev, of_fwnode_handle(np)); dev->dev.parent = parent ? : &platform_bus; if (bus_id) @@ -239,8 +239,7 @@ static struct amba_device *of_amba_device_create(struct device_node *node, dev->dev.dma_mask = &dev->dev.coherent_dma_mask; /* setup generic device info */ - dev->dev.of_node = of_node_get(node); - dev->dev.fwnode = &node->fwnode; + device_set_node(&dev->dev, of_fwnode_handle(node)); dev->dev.parent = parent ? : &platform_bus; dev->dev.platform_data = platform_data; if (bus_id) |