diff --git a/drivers/base/core.c b/drivers/base/core.c index fa3b903a7bea..63c626b55fee 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -118,9 +118,6 @@ static int device_is_dependent(struct device *dev, void *target) return ret; list_for_each_entry(link, &dev->links.consumers, s_node) { - if (link->flags == DL_FLAG_SYNC_STATE_ONLY) - continue; - if (link->consumer == target) return 1; @@ -146,11 +143,8 @@ static int device_reorder_to_tail(struct device *dev, void *not_used) device_pm_move_last(dev); device_for_each_child(dev, NULL, device_reorder_to_tail); - list_for_each_entry(link, &dev->links.consumers, s_node) { - if (link->flags == DL_FLAG_SYNC_STATE_ONLY) - continue; + list_for_each_entry(link, &dev->links.consumers, s_node) device_reorder_to_tail(link->consumer, NULL); - } return 0; } @@ -213,8 +207,6 @@ struct device_link *device_link_add(struct device *consumer, struct device_link *link; if (!consumer || !supplier || - (flags & DL_FLAG_SYNC_STATE_ONLY && - flags != DL_FLAG_SYNC_STATE_ONLY) || (flags & DL_FLAG_STATELESS && flags & (DL_FLAG_AUTOREMOVE_CONSUMER | DL_FLAG_AUTOREMOVE_SUPPLIER))) return NULL; @@ -231,14 +223,11 @@ struct device_link *device_link_add(struct device *consumer, /* * If the supplier has not been fully registered yet or there is a - * reverse (non-SYNC_STATE_ONLY) dependency between the consumer and - * the supplier already in the graph, return NULL. If the link is a - * SYNC_STATE_ONLY link, we don't check for reverse dependencies - * because it only affects sync_state() callbacks. + * reverse dependency between the consumer and the supplier already in + * the graph, return NULL. */ if (!device_pm_initialized(supplier) - || (!(flags & DL_FLAG_SYNC_STATE_ONLY) && - device_is_dependent(consumer, supplier))) { + || device_is_dependent(consumer, supplier)) { link = NULL; goto out; } @@ -272,12 +261,6 @@ struct device_link *device_link_add(struct device *consumer, } kref_get(&link->kref); - - if (link->flags & DL_FLAG_SYNC_STATE_ONLY && - !(flags & DL_FLAG_SYNC_STATE_ONLY)) { - link->flags &= ~DL_FLAG_SYNC_STATE_ONLY; - goto reorder; - } goto out; } @@ -338,9 +321,6 @@ struct device_link *device_link_add(struct device *consumer, } } - if (flags & DL_FLAG_SYNC_STATE_ONLY) - goto out; -reorder: /* * Move the consumer and all of the devices depending on it to the end * of dpm_list and the devices_kset list. @@ -575,8 +555,7 @@ int device_links_check_suppliers(struct device *dev) device_links_write_lock(); list_for_each_entry(link, &dev->links.suppliers, c_node) { - if (link->flags & DL_FLAG_STATELESS || - link->flags & DL_FLAG_SYNC_STATE_ONLY) + if (link->flags & DL_FLAG_STATELESS) continue; if (link->status != DL_STATE_AVAILABLE) { @@ -922,8 +901,7 @@ void device_links_unbind_consumers(struct device *dev) list_for_each_entry(link, &dev->links.consumers, s_node) { enum device_link_state status; - if (link->flags & DL_FLAG_STATELESS || - link->flags & DL_FLAG_SYNC_STATE_ONLY) + if (link->flags & DL_FLAG_STATELESS) continue; status = link->status; diff --git a/include/linux/device.h b/include/linux/device.h index 3e7e81cd80f8..025a57da3550 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -846,14 +846,12 @@ enum device_link_state { * PM_RUNTIME: If set, the runtime PM framework will use this link. * RPM_ACTIVE: Run pm_runtime_get_sync() on the supplier during link creation. * AUTOREMOVE_SUPPLIER: Remove the link automatically on supplier driver unbind. - * SYNC_STATE_ONLY: Link only affects sync_state() behavior. */ #define DL_FLAG_STATELESS BIT(0) #define DL_FLAG_AUTOREMOVE_CONSUMER BIT(1) #define DL_FLAG_PM_RUNTIME BIT(2) #define DL_FLAG_RPM_ACTIVE BIT(3) #define DL_FLAG_AUTOREMOVE_SUPPLIER BIT(4) -#define DL_FLAG_SYNC_STATE_ONLY BIT(7) /** * struct device_link - Device link representation.