[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGETcx9_En10j0DwktXtPDrx=Aqdr2iWEuHmYB-=SnfODTmMfg@mail.gmail.com>
Date: Thu, 5 Nov 2020 11:26:44 -0800
From: Saravana Kannan <saravanak@...gle.com>
To: Mark Brown <broonie@...nel.org>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Matthias Brugger <matthias.bgg@...il.com>,
Nathan Chancellor <natechancellor@...il.com>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Cheng-Jui.Wang@...iatek.com,
Android Kernel Team <kernel-team@...roid.com>,
LKML <linux-kernel@...r.kernel.org>,
linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>,
"moderated list:ARM/Mediatek SoC support"
<linux-mediatek@...ts.infradead.org>,
clang-built-linux <clang-built-linux@...glegroups.com>,
Daniel Mentz <danielmentz@...gle.com>,
linux-spi@...r.kernel.org
Subject: Re: [PATCH v1 2/2] spi: Populate fwnode in of_register_spi_device()
On Thu, Nov 5, 2020 at 9:12 AM Mark Brown <broonie@...nel.org> wrote:
>
> On Wed, Nov 04, 2020 at 12:54:31PM -0800, Saravana Kannan wrote:
> > From: Daniel Mentz <danielmentz@...gle.com>
> >
> > This allows the fw_devlink feature to work for spi devices
> > too. This avoids unnecessary probe deferrals related to spi devices and
> > improves suspend/resume ordering for spi devices when fw_devlink=on.
>
> > of_node_get(nc);
> > spi->dev.of_node = nc;
> > + spi->dev.fwnode = of_fwnode_handle(nc);
>
> Why is this a manual step in an individual subsystem rather than
> something done in the driver core
It can't be done in driver core because "fwnode" is the abstraction
driver core uses. It shouldn't care or know if the firmware is DT,
ACPI or something else -- that's the whole point of fwnode.
> - when would we not want to have the
> fwnode correspond to the of_node,
Never.
> and wouldn't that just be a case of
> checking to see if there is a fwnode already set and only initializing
> if not anyway?
Honestly, we should be deleting device.of_node and always use
device.fwnode. But that's a long way away (lots of clean up). The
"common" place to do this is where a struct device is created from a
firmware (device_node, acpi_device, etc). I don't see a "common place"
for when a device is created out of a device_node, so I think this
patch is a reasonable middle ground.
-Saravana
Powered by blists - more mailing lists