aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorVivek Gautam <vivek.gautam@codeaurora.org>2018-06-27 08:50:55 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2018-07-09 06:14:31 -0400
commite88728f46cfbb59cc7e7acf1d230c05ec093764e (patch)
tree4abf96530a5005bfcc7b733c95d8c020bd5a48cf /drivers/base
parent1e4b044d22517cae7047c99038abb444423243ca (diff)
driver core: Rename flag AUTOREMOVE to AUTOREMOVE_CONSUMER
Now that we want to add another flag to autoremove the device link on supplier unbind, it's fair to rename the existing flag from DL_FLAG_AUTOREMOVE to DL_FLAG_AUTOREMOVE_CONSUMER so that we can add similar flag for supplier later. And, while we are touching device.h, fix a doc build warning. Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/core.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c
index df3e1a44707a..14c1e3151e08 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -178,10 +178,10 @@ void device_pm_move_to_tail(struct device *dev)
178 * of the link. If DL_FLAG_PM_RUNTIME is not set, DL_FLAG_RPM_ACTIVE will be 178 * of the link. If DL_FLAG_PM_RUNTIME is not set, DL_FLAG_RPM_ACTIVE will be
179 * ignored. 179 * ignored.
180 * 180 *
181 * If the DL_FLAG_AUTOREMOVE is set, the link will be removed automatically 181 * If the DL_FLAG_AUTOREMOVE_CONSUMER is set, the link will be removed
182 * when the consumer device driver unbinds from it. The combination of both 182 * automatically when the consumer device driver unbinds from it.
183 * DL_FLAG_AUTOREMOVE and DL_FLAG_STATELESS set is invalid and will cause NULL 183 * The combination of both DL_FLAG_AUTOREMOVE_CONSUMER and DL_FLAG_STATELESS
184 * to be returned. 184 * set is invalid and will cause NULL to be returned.
185 * 185 *
186 * A side effect of the link creation is re-ordering of dpm_list and the 186 * A side effect of the link creation is re-ordering of dpm_list and the
187 * devices_kset list by moving the consumer device and all devices depending 187 * devices_kset list by moving the consumer device and all devices depending
@@ -198,7 +198,8 @@ struct device_link *device_link_add(struct device *consumer,
198 struct device_link *link; 198 struct device_link *link;
199 199
200 if (!consumer || !supplier || 200 if (!consumer || !supplier ||
201 ((flags & DL_FLAG_STATELESS) && (flags & DL_FLAG_AUTOREMOVE))) 201 ((flags & DL_FLAG_STATELESS) &&
202 (flags & DL_FLAG_AUTOREMOVE_CONSUMER)))
202 return NULL; 203 return NULL;
203 204
204 device_links_write_lock(); 205 device_links_write_lock();
@@ -479,7 +480,7 @@ static void __device_links_no_driver(struct device *dev)
479 if (link->flags & DL_FLAG_STATELESS) 480 if (link->flags & DL_FLAG_STATELESS)
480 continue; 481 continue;
481 482
482 if (link->flags & DL_FLAG_AUTOREMOVE) 483 if (link->flags & DL_FLAG_AUTOREMOVE_CONSUMER)
483 kref_put(&link->kref, __device_link_del); 484 kref_put(&link->kref, __device_link_del);
484 else if (link->status != DL_STATE_SUPPLIER_UNBIND) 485 else if (link->status != DL_STATE_SUPPLIER_UNBIND)
485 WRITE_ONCE(link->status, DL_STATE_AVAILABLE); 486 WRITE_ONCE(link->status, DL_STATE_AVAILABLE);
@@ -515,7 +516,7 @@ void device_links_driver_cleanup(struct device *dev)
515 if (link->flags & DL_FLAG_STATELESS) 516 if (link->flags & DL_FLAG_STATELESS)
516 continue; 517 continue;
517 518
518 WARN_ON(link->flags & DL_FLAG_AUTOREMOVE); 519 WARN_ON(link->flags & DL_FLAG_AUTOREMOVE_CONSUMER);
519 WARN_ON(link->status != DL_STATE_SUPPLIER_UNBIND); 520 WARN_ON(link->status != DL_STATE_SUPPLIER_UNBIND);
520 WRITE_ONCE(link->status, DL_STATE_DORMANT); 521 WRITE_ONCE(link->status, DL_STATE_DORMANT);
521 } 522 }