Thread (55 messages) 55 messages, 8 authors, 2025-05-29

Re: [PATCH v2 09/26] cxl/test: Use device_set_node()

From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date: 2025-05-07 15:10:53
Also in: imx, linux-acpi, linux-clk, linux-devicetree, linux-i2c, linux-pci, linux-spi, lkml

On Wed, May 07, 2025 at 09:12:51AM +0200, Herve Codina wrote:
The code set directly dev->fwnode.

Use the dedicated helper to perform this operation.
...
quoted hunk ↗ jump to hunk
@@ -1046,7 +1046,7 @@ static void mock_companion(struct acpi_device *adev, struct device *dev)
 {
 	device_initialize(&adev->dev);
 	fwnode_init(&adev->fwnode, NULL);
-	dev->fwnode = &adev->fwnode;
+	device_set_node(dev, &adev->fwnode);
 	adev->fwnode.dev = dev;
 }
This code is questionable to begin with. Can the original author explain what
is the motivation behind this as the only callers of fwnode_init() are deep
core pieces _and_ this only module. Why?!

-- 
With Best Regards,
Andy Shevchenko


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help