software node: Allow node addition to already existing device
Subsystems (3)
Heikki Krogerus
reviewerPATCH 1/1 software node: Allow node addition to already existing device
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.
--- drivers/base/swnode.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/base/swnode.c +3 -2
@@ -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 ;
Signature · 1 line
2.30.2
Heikki Krogerus
reviewer+Greg
Sorry about that. Should I resend this?
Quoted 38 lines · Heikki Krogerus
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 <[email protected]>Fixes e68d0119e328 ("software node: Introduce device_add_software_node()")Signed-off-by Heikki Krogerus <[email protected]>--- drivers/base/swnode.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/base/swnode.c +3
-2@@ -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 ;Signature · 1 line
2.30.2
Signature · 1 line
heikki
Greg Kroah-Hartman
maintainerQuoted 3 lines · Heikki Krogerus
+Greg
Sorry about that. Should I resend this?
No worries, I can pick it up, thanks
b4 really is nice to use :)
greg k-h
Heikki Krogerus
reviewerQuoted 8 lines · Greg Kroah-Hartman
Quoted 3 lines · Heikki Krogerus
+Greg
Sorry about that. Should I resend this?
No worries, I can pick it up, thanks
b4really is nice to use :)
Yes, it's a really nice tool.
thanks,
Signature · 1 line
heikki