mirror of
https://github.com/ukui/kernel.git
synced 2026-03-09 10:07:04 -07:00
driver core: Update device link status properly for device_bind_driver()
Device link status was not getting updated correctly when device_bind_driver() is called on a device. This causes a warning[1]. Fix this by updating device links that can be updated and dropping device links that can't be updated to a sensible state. [1] - https://lore.kernel.org/lkml/56f7d032-ba5a-a8c7-23de-2969d98c527e@nvidia.com/ Tested-by: Jon Hunter <jonathanh@nvidia.com> Signed-off-by: Saravana Kannan <saravanak@google.com> Link: https://lore.kernel.org/r/20210302211133.2244281-3-saravanak@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
f2db85b64f
commit
b6f617df4f
+3
-1
@@ -459,8 +459,10 @@ int device_bind_driver(struct device *dev)
|
||||
int ret;
|
||||
|
||||
ret = driver_sysfs_add(dev);
|
||||
if (!ret)
|
||||
if (!ret) {
|
||||
device_links_force_bind(dev);
|
||||
driver_bound(dev);
|
||||
}
|
||||
else if (dev->bus)
|
||||
blocking_notifier_call_chain(&dev->bus->p->bus_notifier,
|
||||
BUS_NOTIFY_DRIVER_NOT_BOUND, dev);
|
||||
|
||||
Reference in New Issue
Block a user