Re: [PATCH v3 06/28] driver core: fw_devlink: Introduce fw_devlink_set_device()

From: Herve Codina
Date: Mon Jun 16 2025 - 03:04:36 EST


Hi Saravana,

On Fri, 13 Jun 2025 14:13:49 -0700
Saravana Kannan <saravanak@xxxxxxxxxx> wrote:

> On Fri, Jun 13, 2025 at 6:49 AM Herve Codina <herve.codina@xxxxxxxxxxx> wrote:
> >
> > Setting fwnode->dev is specific to fw_devlink.
> >
> > In order to avoid having a direct 'fwnode->dev = dev;' in several
> > place in the kernel, introduce fw_devlink_set_device() helper to perform
> > this operation.
> >
>
> This should not be set anywhere outside the driver core files. I'll
> get to reviewing the series, but until then, NACK to this.
>
> Is there a specific patch that explain why we need to set this outside
> driver core?

We need to set it in case of creating device-tree node for PCI.

Usually, fwnode are created (based on DT or ACPI) and then, dev are
created.

In the PCI DT node creation case, device are already created and then, based
on information already computed by the kernel, DT node are created.

You can see that on patch 11 (dev setting was already upstream and it is
replace by a call to the helper for PCI host bridge) and on patch 13 (PCI
device).

Other patches (8, 9 and 10) replace the existing direct setting of the dev
member by a call to the helper.

Best regards,
Hervé