[0/2] devlink: Take care of FWNODE_FLAG_NOT_DEVICE in case of DT overlays

Message ID 20240220111044.133776-1-herve.codina@bootlin.com
Headers
Series devlink: Take care of FWNODE_FLAG_NOT_DEVICE in case of DT overlays |

Message

Herve Codina Feb. 20, 2024, 11:10 a.m. UTC
  Since commit 1a50d9403fb9 ("treewide: Fix probing of devices in DT
overlays"), the FWNODE_FLAG_NOT_DEVICE is set on nodes present in the
overlay. Having this flag set leads to some wrong devlink links.
For instance, some links can be created with a supplier set to a parent
device instead of the device itself.

This series clears the FWNODE_FLAG_NOT_DEVICE in some specific location
to fix the wrong links issues.
- device_add()
  When a device is added, the related fwnode (if any) is populated as
  a struct device. It makes sense to clear the flag at that point and so
  avoid differences between DT used with or without overlays.
- of_link_phandle()
  If the supplier device has a compatible string and 'is available', a
  device is going to be created soon to handle this node. In that case,
  to avoid a link created using the supplier parent device instead of
  the device itself, clearing the FWNODE_FLAG_NOT_DEVICE makes sense.

Best regards,
Hervé Codina

Herve Codina (2):
  driver core: Clear FWNODE_FLAG_NOT_DEVICE when a device is added
  of: property: fw_devlink: Fix links to supplier when created from
    phandles

 drivers/base/core.c   |  1 +
 drivers/of/property.c | 16 +++++++++++++++-
 2 files changed, 16 insertions(+), 1 deletion(-)