Re: [PATCH v23 08/13] mfd: core: Add firmware-node support to MFD cells

Shivendra Pratap <[email protected]>
Newsgroups dev.linux.lists.mfd,dev.linux.lists.sashiko-reviews,org.kernel.vger.linux-devicetree
Message-ID <[email protected]>

On 14-07-2026 23:00, [email protected] wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [High] Strict enforcement of `named_fwnode` aborts the entire MFD probe if the node is missing.
> --
> 
> --- Patch [8]: [PATCH v23 08/13] mfd: core: Add firmware-node support to MFD cells ---
> commit c957d9fd3d002c62018221b0f97f57bad5c0b519
> Author: Shivendra Pratap <[email protected]>
> 
> mfd: core: Add firmware-node support to MFD cells
> 
> This commit extends struct mfd_cell with a named firmware-node field to allow
> registering a child device using an explicit firmware node. It uses this as a
> fallback when no firmware node is assigned by device tree, ACPI, or software
> matching.
> 
>> diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c
>> index 7aa32b90cf1eb..ba9682ead2cad 100644
>> --- a/drivers/mfd/mfd-core.c
>> +++ b/drivers/mfd/mfd-core.c
> [ ... ]
>> @@ -224,6 +289,37 @@ static int mfd_add_device(struct device *parent, int id,
>>   
>>   	mfd_acpi_add_device(cell, pdev);
>>   
>> +	/* named_fwnode is a fallback only when no OF/ACPI match and no swnode */
>> +	if (!pdev->dev.fwnode && !cell->swnode && cell->named_fwnode) {
>> +		struct device_node *named_np;
>> +
>> +		fwnode = device_get_named_child_node(parent, cell->named_fwnode);
>> +		if (!fwnode) {
>> +			ret = -ENODEV;
>> +			goto fail_alias;
>> +		}
> 
> [Severity: High]
> Will this strict enforcement cause the entire MFD parent probe to fail if an
> optional child node is missing?
> 
> Unlike the permissive of_compatible match that merely warns and bypasses
> missing nodes, returning -ENODEV here cascades up to mfd_add_devices(). This
> causes a failure that unwinds all active child devices and blocks the parent
> driver's probe.
> 
> Should a missing named firmware node be treated less strictly so it doesn't
> disable unrelated MFD functions?

We can allow probe to continue if the named_fwnode is not found. Will 
wait for some more reviews around this.

thanks,
Shivendra
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.