Re: [PATCH v23 08/13] mfd: core: Add firmware-node support to MFD cells
Bartosz Golaszewski <[email protected]> Wed, 22 Jul 2026 03:01:32 -0700
| Newsgroups | dev.linux.lists.mfd,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel,org.kernel.vger.linux-pm |
|---|---|
| Message-ID | <CAMRc=Mdo=vEOUD0=U0dWu3ry7_ZqLaFz4Mwk_qv2viYQYNAq=g@mail.gmail.com> |
On Tue, 21 Jul 2026 14:48:46 +0200, Shivendra Pratap <[email protected]> said: >> >>> + struct device_node *named_np; >>> + >>> + fwnode = device_get_named_child_node(parent, cell->named_fwnode); >>> + if (!fwnode) { >>> + ret = -ENODEV; >>> + goto fail_alias; >>> + } >>> + >>> + named_np = to_of_node(fwnode); >>> + if (named_np) { >>> + ret = mfd_claim_of_node_to_dev(pdev, named_np); >>> + fwnode_handle_put(fwnode); >>> + if (ret == -EAGAIN) >>> + ret = -EBUSY; >>> + if (ret) >>> + goto fail_alias; >>> + } else { >>> + ret = mfd_claim_named_fwnode(pdev, fwnode); >>> + if (ret) { >>> + fwnode_handle_put(fwnode); >>> + if (ret == -EAGAIN) >>> + ret = -EBUSY; >>> + goto fail_alias; >>> + } >>> + device_set_node(&pdev->dev, fwnode); >>> + fwnode_handle_put(fwnode); >>> + } >> >> What is the reason to have this split into OF and fwnode functions? I don't >> really see why you would need to do it twice, isn't fwnode sufficient for the >> OF node case too? > > We do a duplicate check here before adding the named_fwnode and split it > for two reasons: > 1. of_node list pre-exists. We add a new list of fwnode. of_node based > duplicate check go wrong, if its checked with the fwnode list. > 2. of_node need to go to its respective list as fwnode list, release > path, is different for us. > I see. This could use a unification to fwnodes as well but that's out of scope for this series. Bart