--- a/drivers/base/core.c
+++ b/drivers/base/core.c
-@@ -162,10 +162,10 @@ static int device_reorder_to_tail(struct
+@@ -177,10 +177,10 @@ static int device_reorder_to_tail(struct
* of the link. If DL_FLAG_PM_RUNTIME is not set, DL_FLAG_RPM_ACTIVE will be
* ignored.
*
*
* A side effect of the link creation is re-ordering of dpm_list and the
* devices_kset list by moving the consumer device and all devices depending
-@@ -183,7 +183,8 @@ struct device_link *device_link_add(stru
+@@ -198,7 +198,8 @@ struct device_link *device_link_add(stru
bool rpm_put_supplier = false;
if (!consumer || !supplier ||
return NULL;
if (flags & DL_FLAG_PM_RUNTIME && flags & DL_FLAG_RPM_ACTIVE) {
-@@ -209,8 +210,10 @@ struct device_link *device_link_add(stru
+@@ -224,8 +225,10 @@ struct device_link *device_link_add(stru
}
list_for_each_entry(link, &supplier->links.consumers, s_node)
link = kzalloc(sizeof(*link), GFP_KERNEL);
if (!link)
-@@ -237,6 +240,7 @@ struct device_link *device_link_add(stru
+@@ -252,6 +255,7 @@ struct device_link *device_link_add(stru
link->consumer = consumer;
INIT_LIST_HEAD(&link->c_node);
link->flags = flags;
/* Determine the initial link state. */
if (flags & DL_FLAG_STATELESS) {
-@@ -311,8 +315,10 @@ static void __device_link_free_srcu(stru
+@@ -326,8 +330,10 @@ static void __device_link_free_srcu(stru
device_link_free(container_of(rhead, struct device_link, rcu_head));
}
dev_info(link->consumer, "Dropping the link to %s\n",
dev_name(link->supplier));
-@@ -324,8 +330,10 @@ static void __device_link_del(struct dev
+@@ -339,8 +345,10 @@ static void __device_link_del(struct dev
call_srcu(&device_links_srcu, &link->rcu_head, __device_link_free_srcu);
}
#else /* !CONFIG_SRCU */
dev_info(link->consumer, "Dropping the link to %s\n",
dev_name(link->supplier));
-@@ -343,18 +351,50 @@ static void __device_link_del(struct dev
+@@ -358,18 +366,50 @@ static void __device_link_del(struct dev
* @link: Device link to delete.
*
* The caller must ensure proper synchronization of this function with runtime
static void device_links_missing_supplier(struct device *dev)
{
struct device_link *link;
-@@ -462,8 +502,8 @@ static void __device_links_no_driver(str
+@@ -477,8 +517,8 @@ static void __device_links_no_driver(str
if (link->flags & DL_FLAG_STATELESS)
continue;
else if (link->status != DL_STATE_SUPPLIER_UNBIND)
WRITE_ONCE(link->status, DL_STATE_AVAILABLE);
}
-@@ -498,8 +538,18 @@ void device_links_driver_cleanup(struct
+@@ -513,8 +553,18 @@ void device_links_driver_cleanup(struct
if (link->flags & DL_FLAG_STATELESS)
continue;
WRITE_ONCE(link->status, DL_STATE_DORMANT);
}
-@@ -616,13 +666,13 @@ static void device_links_purge(struct de
+@@ -631,13 +681,13 @@ static void device_links_purge(struct de
list_for_each_entry_safe_reverse(link, ln, &dev->links.suppliers, c_node) {
WARN_ON(link->status == DL_STATE_ACTIVE);
}
device_links_write_unlock();
-@@ -1044,6 +1094,34 @@ static ssize_t online_store(struct devic
+@@ -1059,6 +1109,34 @@ static ssize_t online_store(struct devic
}
static DEVICE_ATTR_RW(online);
int device_add_groups(struct device *dev, const struct attribute_group **groups)
{
return sysfs_create_groups(&dev->kobj, groups);
-@@ -1215,8 +1293,20 @@ static int device_add_attrs(struct devic
+@@ -1230,8 +1308,20 @@ static int device_add_attrs(struct devic
goto err_remove_dev_groups;
}
err_remove_dev_groups:
device_remove_groups(dev, dev->groups);
err_remove_type_groups:
-@@ -1234,6 +1324,8 @@ static void device_remove_attrs(struct d
+@@ -1249,6 +1339,8 @@ static void device_remove_attrs(struct d
struct class *class = dev->class;
const struct device_type *type = dev->type;