Commit df4ebb7f authored by Saravana Kannan's avatar Saravana Kannan Committed by Greg Kroah-Hartman

driver core: Skip unnecessary work when device doesn't have sync_state()

commit 77036165 upstream.

A bunch of busy work is done for devices that don't have sync_state()
support. Stop doing the busy work.
Signed-off-by: default avatarSaravana Kannan <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Cc: Davide Caratti <[email protected]>
Signed-off-by: default avatarGreg Kroah-Hartman <[email protected]>
parent 6d88283a
......@@ -718,6 +718,8 @@ static void __device_links_queue_sync_state(struct device *dev,
{
struct device_link *link;
if (!dev_has_sync_state(dev))
return;
if (dev->state_synced)
return;
......@@ -819,7 +821,7 @@ late_initcall(sync_state_resume_initcall);
static void __device_links_supplier_defer_sync(struct device *sup)
{
if (list_empty(&sup->links.defer_sync))
if (list_empty(&sup->links.defer_sync) && dev_has_sync_state(sup))
list_add_tail(&sup->links.defer_sync, &deferred_sync);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment