From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
linux-kernel@vger.kernel.org,
Sakari Ailus <sakari.ailus@linux.intel.com>
Subject: Re: [PATCH v1] drivers property: When no children in primary, try secondary
Date: Wed, 20 May 2020 13:39:09 +0300 [thread overview]
Message-ID: <20200520103909.GG1298122@kuha.fi.intel.com> (raw)
In-Reply-To: <20200520102959.34812-1-andriy.shevchenko@linux.intel.com>
On Wed, May 20, 2020 at 01:29:59PM +0300, Andy Shevchenko wrote:
> Software firmware nodes can provide a child node to its parent.
> Since software node can be secondary, we need a mechanism to access
> the children. The idea is to list children of the primary node first
> and when they are finished, continue with secondary node if available.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
FWIW:
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
> drivers/base/property.c | 13 +++++++++++--
> 1 file changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/base/property.c b/drivers/base/property.c
> index 5f35c0ccf5e0..1e6d75e65938 100644
> --- a/drivers/base/property.c
> +++ b/drivers/base/property.c
> @@ -708,14 +708,23 @@ struct fwnode_handle *device_get_next_child_node(struct device *dev,
> struct fwnode_handle *child)
> {
> struct acpi_device *adev = ACPI_COMPANION(dev);
> - struct fwnode_handle *fwnode = NULL;
> + struct fwnode_handle *fwnode = NULL, *next;
>
> if (dev->of_node)
> fwnode = &dev->of_node->fwnode;
> else if (adev)
> fwnode = acpi_fwnode_handle(adev);
>
> - return fwnode_get_next_child_node(fwnode, child);
> + /* Try to find a child in primary fwnode */
> + next = fwnode_get_next_child_node(fwnode, child);
> + if (next)
> + return next;
> +
> + /* When no more children in primary, continue with secondary */
> + if (!IS_ERR_OR_NULL(fwnode->secondary))
> + next = fwnode_get_next_child_node(fwnode->secondary, child);
> +
> + return next;
> }
> EXPORT_SYMBOL_GPL(device_get_next_child_node);
Thanks Andy,
--
heikki
prev parent reply other threads:[~2020-05-20 10:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-20 10:29 Andy Shevchenko
2020-05-20 10:34 ` Rafael J. Wysocki
2020-05-20 10:48 ` Greg Kroah-Hartman
2020-05-20 10:36 ` Sakari Ailus
2020-05-20 10:39 ` Heikki Krogerus [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=20200520103909.GG1298122@kuha.fi.intel.com \
--to=heikki.krogerus@linux.intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=sakari.ailus@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
all inboxes | Powered by JetHome®