[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YHayP0cTOGMSoPNR@kuha.fi.intel.com>
Date: Wed, 14 Apr 2021 12:13:35 +0300
From: Heikki Krogerus <heikki.krogerus@...ux.intel.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>,
linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] software node: Allow node addition to already existing
device
+Greg
Sorry about that. Should I resend this?
On Wed, Apr 14, 2021 at 10:54:38AM +0300, Heikki Krogerus wrote:
> If the node is added to an already exiting device, the node
> needs to be also linked to the device separately.
>
> This will make sure the reference count is kept in balance
> also when the node is injected to a device afterwards.
>
> Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
> Fixes: e68d0119e328 ("software node: Introduce device_add_software_node()")
> Signed-off-by: Heikki Krogerus <heikki.krogerus@...ux.intel.com>
> ---
> drivers/base/swnode.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/base/swnode.c b/drivers/base/swnode.c
> index 740333629b420..3cc11b813f28c 100644
> --- a/drivers/base/swnode.c
> +++ b/drivers/base/swnode.c
> @@ -1045,6 +1045,7 @@ int device_add_software_node(struct device *dev, const struct software_node *nod
> }
>
> set_secondary_fwnode(dev, &swnode->fwnode);
> + software_node_notify(dev, KOBJ_ADD);
>
> return 0;
> }
> @@ -1118,8 +1119,8 @@ int software_node_notify(struct device *dev, unsigned long action)
>
> switch (action) {
> case KOBJ_ADD:
> - ret = sysfs_create_link(&dev->kobj, &swnode->kobj,
> - "software_node");
> + ret = sysfs_create_link_nowarn(&dev->kobj, &swnode->kobj,
> + "software_node");
> if (ret)
> break;
>
> --
> 2.30.2
--
heikki
Powered by blists - more mailing lists