[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YD0D6/NQpDdj1WeX@smile.fi.intel.com>
Date: Mon, 1 Mar 2021 17:10:35 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Heikki Krogerus <heikki.krogerus@...ux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
linux-kernel@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [PATCH 1/2] software node: Fix node registration
On Mon, Mar 01, 2021 at 05:30:11PM +0300, Heikki Krogerus wrote:
> Software node can not be registered before its parent.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Tested-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
(On Intel Galileo Gen 2 with some custom patches to convert gpio-dwapb et al.
to use swnodes. Those patches a subject to further submission.)
Thanks!
> Fixes: 80488a6b1d3c ("software node: Add support for static node descriptors")
> Cc: stable@...r.kernel.org
> Signed-off-by: Heikki Krogerus <heikki.krogerus@...ux.intel.com>
> ---
> drivers/base/swnode.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/base/swnode.c b/drivers/base/swnode.c
> index 37179a8b1ceba..74db8c971db74 100644
> --- a/drivers/base/swnode.c
> +++ b/drivers/base/swnode.c
> @@ -938,6 +938,9 @@ int software_node_register(const struct software_node *node)
> if (software_node_to_swnode(node))
> return -EEXIST;
>
> + if (node->parent && !parent)
> + return -EINVAL;
> +
> return PTR_ERR_OR_ZERO(swnode_register(node, parent, 0));
> }
> EXPORT_SYMBOL_GPL(software_node_register);
> --
> 2.30.1
>
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists