Re: [PATCH v10 2/2] i2c: mux: Propagate firmware nodes to channel adapters
From: Andy Shevchenko
Date: Tue Sep 08 2026 - 07:03:08 EST
On Mon, Sep 07, 2026 at 11:26:23PM -0700, Ahmad Byagowi wrote:
> Device Tree channel nodes are associated with the adapters created by
> i2c-mux, but equivalent firmware-node descriptions are not.
>
> Use generic firmware-node operations for the existing channel lookup
> and associate the returned node with the adapter. Do not restrict the
> lookup by firmware-node type, so Device Tree, software nodes, and ACPI
> descriptions all follow the same property traversal. The existing
> acpi_preset_companion() call remains in place for the standard ACPI
> channel association.
>
> Keep a separate reference to the node returned by the generic lookup
> because acpi_preset_companion() may replace the device's primary
> firmware node. Release the saved reference after adapter deletion.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
...
> - struct device_node *dev_node;
> - struct device_node *mux_node;
> - struct device_node *child;
> + struct fwnode_handle *dev_node;
> + struct fwnode_handle *mux_node;
> + struct fwnode_handle *child;
When the local variable changes the type (usually this is related to
the pointers) the best practice is to rename. In such a case it will
avoid the cases when some API accepts void * and the change would not
have been noticed until run-time crash or subtle issues.
I hope here it's just a mechanical stuff and we don't have side effects
as per above.
--
With Best Regards,
Andy Shevchenko