Skip to content

Commit 7703616

Browse files
Saravana Kannangregkh
authored andcommitted
driver core: Skip unnecessary work when device doesn't have sync_state()
A bunch of busy work is done for devices that don't have sync_state() support. Stop doing the busy work. Signed-off-by: Saravana Kannan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent ac338ac commit 7703616

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/base/core.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,8 @@ static void __device_links_queue_sync_state(struct device *dev,
718718
{
719719
struct device_link *link;
720720

721+
if (!dev_has_sync_state(dev))
722+
return;
721723
if (dev->state_synced)
722724
return;
723725

@@ -819,7 +821,7 @@ late_initcall(sync_state_resume_initcall);
819821

820822
static void __device_links_supplier_defer_sync(struct device *sup)
821823
{
822-
if (list_empty(&sup->links.defer_sync))
824+
if (list_empty(&sup->links.defer_sync) && dev_has_sync_state(sup))
823825
list_add_tail(&sup->links.defer_sync, &deferred_sync);
824826
}
825827

0 commit comments

Comments
 (0)