Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mfd: core: Preserve OF node when ACPI handle is present

Switch device_set_node to set_primary_fwnode, so that the ACPI fwnode
does not overwrite the of_node with NULL.

This allows MFD children with both OF nodes and ACPI handles to have OF
nodes again.

Cc: stable@vger.kernel.org
Fixes: 51e3b257099d ("mfd: core: Make use of device_set_node()")
Signed-off-by: Brian Mak <makb@juniper.net>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20260325223024.35992-1-makb@juniper.net
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Brian Mak and committed by
Lee Jones
caa5a5d4 70910aad

+11 -1
+11 -1
drivers/mfd/mfd-core.c
··· 88 88 } 89 89 } 90 90 91 - device_set_node(&pdev->dev, acpi_fwnode_handle(adev ?: parent)); 91 + /* 92 + * NOTE: The fwnode design doesn't allow proper stacking/sharing. This 93 + * should eventually turn into a device fwnode API call that will allow 94 + * prepending to a list of fwnodes (with ACPI taking precedence). 95 + * 96 + * set_primary_fwnode() is used here, instead of device_set_node(), as 97 + * device_set_node() will overwrite the existing fwnode, which may be an 98 + * OF node that was populated earlier. To support a use case where ACPI 99 + * and OF is used in conjunction, we call set_primary_fwnode() instead. 100 + */ 101 + set_primary_fwnode(&pdev->dev, acpi_fwnode_handle(adev ?: parent)); 92 102 } 93 103 #else 94 104 static inline void mfd_acpi_add_device(const struct mfd_cell *cell,