Revert "driver core: Add edit_links() callback for drivers"
This reverts commit 134b23eec9
.
Based on a lot of email and in-person discussions, this patch series is
being reworked to address a number of issues that were pointed out that
needed to be taken care of before it should be merged. It will be
resubmitted with those changes hopefully soon.
Cc: Frank Rowand <frowand.list@gmail.com>
Cc: Saravana Kannan <saravanak@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
@@ -439,19 +439,6 @@ static void device_link_wait_for_supplier(struct device *consumer)
|
||||
mutex_unlock(&wfs_lock);
|
||||
}
|
||||
|
||||
/**
|
||||
* device_link_remove_from_wfs - Unmark device as waiting for supplier
|
||||
* @consumer: Consumer device
|
||||
*
|
||||
* Unmark the consumer device as waiting for suppliers to become available.
|
||||
*/
|
||||
void device_link_remove_from_wfs(struct device *consumer)
|
||||
{
|
||||
mutex_lock(&wfs_lock);
|
||||
list_del_init(&consumer->links.needs_suppliers);
|
||||
mutex_unlock(&wfs_lock);
|
||||
}
|
||||
|
||||
/**
|
||||
* device_link_check_waiting_consumers - Try to unmark waiting consumers
|
||||
*
|
||||
@@ -469,19 +456,12 @@ void device_link_remove_from_wfs(struct device *consumer)
|
||||
static void device_link_check_waiting_consumers(void)
|
||||
{
|
||||
struct device *dev, *tmp;
|
||||
int ret;
|
||||
|
||||
mutex_lock(&wfs_lock);
|
||||
list_for_each_entry_safe(dev, tmp, &wait_for_suppliers,
|
||||
links.needs_suppliers) {
|
||||
ret = 0;
|
||||
if (dev->has_edit_links)
|
||||
ret = driver_edit_links(dev);
|
||||
else if (dev->bus->add_links)
|
||||
ret = dev->bus->add_links(dev);
|
||||
if (!ret)
|
||||
links.needs_suppliers)
|
||||
if (!dev->bus->add_links(dev))
|
||||
list_del_init(&dev->links.needs_suppliers);
|
||||
}
|
||||
mutex_unlock(&wfs_lock);
|
||||
}
|
||||
|
||||
|
@@ -710,12 +710,6 @@ int driver_probe_device(struct device_driver *drv, struct device *dev)
|
||||
pr_debug("bus: '%s': %s: matched device %s with driver %s\n",
|
||||
drv->bus->name, __func__, dev_name(dev), drv->name);
|
||||
|
||||
if (drv->edit_links) {
|
||||
if (drv->edit_links(dev))
|
||||
dev->has_edit_links = true;
|
||||
else
|
||||
device_link_remove_from_wfs(dev);
|
||||
}
|
||||
pm_runtime_get_suppliers(dev);
|
||||
if (dev->parent)
|
||||
pm_runtime_get_sync(dev->parent);
|
||||
@@ -804,29 +798,6 @@ struct device_attach_data {
|
||||
bool have_async;
|
||||
};
|
||||
|
||||
static int __driver_edit_links(struct device_driver *drv, void *data)
|
||||
{
|
||||
struct device *dev = data;
|
||||
|
||||
if (!drv->edit_links)
|
||||
return 0;
|
||||
|
||||
if (driver_match_device(drv, dev) <= 0)
|
||||
return 0;
|
||||
|
||||
return drv->edit_links(dev);
|
||||
}
|
||||
|
||||
int driver_edit_links(struct device *dev)
|
||||
{
|
||||
int ret;
|
||||
|
||||
device_lock(dev);
|
||||
ret = bus_for_each_drv(dev->bus, NULL, dev, __driver_edit_links);
|
||||
device_unlock(dev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int __device_attach_driver(struct device_driver *drv, void *_data)
|
||||
{
|
||||
struct device_attach_data *data = _data;
|
||||
|
Reference in New Issue
Block a user