mirror of
https://github.com/torvalds/linux.git
synced 2026-09-25 21:21:09 -04:00
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.
Fixes: e68d0119e3 ("software node: Introduce device_add_software_node()")
Reported-by: Pierre-Louis Bossart <[email protected]>
Signed-off-by: Heikki Krogerus <[email protected]>
Cc: stable <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
586c402882
commit
b622b24519
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user