UPSTREAM: driver core: Rename dev_links_info.defer_sync to defer_hook

The defer_sync field is used as a hook to add the device to the
deferred_sync list. Rename it so that it's more meaningful for the next
patch that'll also use this field as a hook to a deferred_fw_devlink
list.

Signed-off-by: Saravana Kannan <saravanak@google.com>
Reviewed-by: Rafael J. Wysocki <rafael@kernel.org>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20200701194259.3337652-3-saravanak@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit ec7bd78498f29680f536451fbdf9464e851273ed)
Signed-off-by: Saravana Kannan <saravanak@google.com>
Bug: 157691602
Change-Id: Ia213a9b8b6efc33882f5b2cfaad284ee0eca8cd4
Git-repo: https://android.googlesource.com/kernel/common
Git-commit: 7d2718b6ffe2735b89c5ea822f1b78eec5ac28f9
[spathi@codeaurora.org: resolved trivial conflicts]
Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
This commit is contained in:
Saravana Kannan
2020-07-01 12:42:58 -07:00
committed by Srinivasarao P
parent 8bc7337c62
commit 508be47d4f
2 changed files with 13 additions and 13 deletions

View File

@@ -738,11 +738,11 @@ static void __device_links_queue_sync_state(struct device *dev,
*/
dev->state_synced = true;
if (WARN_ON(!list_empty(&dev->links.defer_sync)))
if (WARN_ON(!list_empty(&dev->links.defer_hook)))
return;
get_device(dev);
list_add_tail(&dev->links.defer_sync, list);
list_add_tail(&dev->links.defer_hook, list);
}
/**
@@ -760,8 +760,8 @@ static void device_links_flush_sync_list(struct list_head *list,
{
struct device *dev, *tmp;
list_for_each_entry_safe(dev, tmp, list, links.defer_sync) {
list_del_init(&dev->links.defer_sync);
list_for_each_entry_safe(dev, tmp, list, links.defer_hook) {
list_del_init(&dev->links.defer_hook);
if (dev != dont_lock_dev)
device_lock(dev);
@@ -799,12 +799,12 @@ void device_links_supplier_sync_state_resume(void)
if (defer_sync_state_count)
goto out;
list_for_each_entry_safe(dev, tmp, &deferred_sync, links.defer_sync) {
list_for_each_entry_safe(dev, tmp, &deferred_sync, links.defer_hook) {
/*
* Delete from deferred_sync list before queuing it to
* sync_list because defer_sync is used for both lists.
* sync_list because defer_hook is used for both lists.
*/
list_del_init(&dev->links.defer_sync);
list_del_init(&dev->links.defer_hook);
__device_links_queue_sync_state(dev, &sync_list);
}
out:
@@ -822,8 +822,8 @@ late_initcall(sync_state_resume_initcall);
static void __device_links_supplier_defer_sync(struct device *sup)
{
if (list_empty(&sup->links.defer_sync))
list_add_tail(&sup->links.defer_sync, &deferred_sync);
if (list_empty(&sup->links.defer_hook))
list_add_tail(&sup->links.defer_hook, &deferred_sync);
}
static void device_link_drop_managed(struct device_link *link)
@@ -1036,7 +1036,7 @@ void device_links_driver_cleanup(struct device *dev)
WRITE_ONCE(link->status, DL_STATE_DORMANT);
}
list_del_init(&dev->links.defer_sync);
list_del_init(&dev->links.defer_hook);
__device_links_no_driver(dev);
device_links_write_unlock();
@@ -2091,7 +2091,7 @@ void device_initialize(struct device *dev)
INIT_LIST_HEAD(&dev->links.consumers);
INIT_LIST_HEAD(&dev->links.suppliers);
INIT_LIST_HEAD(&dev->links.needs_suppliers);
INIT_LIST_HEAD(&dev->links.defer_sync);
INIT_LIST_HEAD(&dev->links.defer_hook);
dev->links.status = DL_DEV_NO_DRIVER;
}
EXPORT_SYMBOL_GPL(device_initialize);

View File

@@ -922,7 +922,7 @@ enum dl_dev_state {
* @suppliers: List of links to supplier devices.
* @consumers: List of links to consumer devices.
* @needs_suppliers: Hook to global list of devices waiting for suppliers.
* @defer_sync: Hook to global list of devices that have deferred sync_state.
* @defer_hook: Hook to global list of devices that have deferred sync_state.
* @need_for_probe: If needs_suppliers is on a list, this indicates if the
* suppliers are needed for probe or not.
* @status: Driver status information.
@@ -931,7 +931,7 @@ struct dev_links_info {
struct list_head suppliers;
struct list_head consumers;
struct list_head needs_suppliers;
struct list_head defer_sync;
struct list_head defer_hook;
bool need_for_probe;
enum dl_dev_state status;
};