From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Heikki Krogerus <heikki.krogerus@linux.intel.com>,
Bard Liao <yung-chuan.liao@linux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
bard.liao@intel.com
Subject: Re: [PATCH 2/2] device property: add description of fwnode cases
Date: Thu, 7 Jan 2021 17:58:39 +0100 [thread overview]
Message-ID: <CAJZ5v0go48B+3QV5zreg1yxy2KnvLdp5p=n2Rb+D8XyBtb=Rbg@mail.gmail.com> (raw)
In-Reply-To: <20210107141123.GI940479@kuha.fi.intel.com>
On Thu, Jan 7, 2021 at 3:11 PM Heikki Krogerus
<heikki.krogerus@linux.intel.com> wrote:
>
> On Tue, Jan 05, 2021 at 05:11:46PM +0800, Bard Liao wrote:
> > There are only four valid fwnode cases which are
> > - primary --> secondary --> -ENODEV
> > - primary --> NULL
> > - secondary --> -ENODEV
> > - NULL
> >
> > dev->fwnode should be converted between the 4 cases above no matter
> > how/when set_primary_fwnode() and set_secondary_fwnode() are called.
> > Describe it in the code so people will keep it in mind.
> >
> > Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
>
> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
>
> > ---
> > drivers/base/core.c | 7 +++++++
> > 1 file changed, 7 insertions(+)
> >
> > diff --git a/drivers/base/core.c b/drivers/base/core.c
> > index 51b9545a050b..17eb14607074 100644
> > --- a/drivers/base/core.c
> > +++ b/drivers/base/core.c
> > @@ -4414,6 +4414,12 @@ static inline bool fwnode_is_primary(struct fwnode_handle *fwnode)
> > *
> > * Set the device's firmware node pointer to @fwnode, but if a secondary
> > * firmware node of the device is present, preserve it.
> > + *
> > + * Valid fwnode cases are:
> > + * - primary --> secondary --> -ENODEV
> > + * - primary --> NULL
> > + * - secondary --> -ENODEV
> > + * - NULL
> > */
> > void set_primary_fwnode(struct device *dev, struct fwnode_handle *fwnode)
> > {
> > @@ -4432,6 +4438,7 @@ void set_primary_fwnode(struct device *dev, struct fwnode_handle *fwnode)
> > } else {
> > if (fwnode_is_primary(fn)) {
> > dev->fwnode = fn->secondary;
> > + /* Set fn->secondary = NULL to keep fn as a primary fwnode */
> > if (!(parent && fn == parent->fwnode))
> > fn->secondary = NULL;
> > } else {
> > --
Applied (with a minor edit in the new comment) along with the [1/2] as
5.11-rc material, thanks!
prev parent reply other threads:[~2021-01-07 16:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-05 9:11 [PATCH 0/2] Revert "device property: Keep secondary firmware node secondary by type" Bard Liao
2021-01-05 9:11 ` [PATCH 1/2] " Bard Liao
2021-01-05 14:44 ` Andy Shevchenko
2021-01-07 14:10 ` Heikki Krogerus
2021-01-05 9:11 ` [PATCH 2/2] device property: add description of fwnode cases Bard Liao
2021-01-05 14:44 ` Andy Shevchenko
2021-01-07 14:11 ` Heikki Krogerus
2021-01-07 16:58 ` Rafael J. Wysocki [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAJZ5v0go48B+3QV5zreg1yxy2KnvLdp5p=n2Rb+D8XyBtb=Rbg@mail.gmail.com' \
--to=rafael@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=bard.liao@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=yung-chuan.liao@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).