Merge generic_lookup_helpers into usb-next

The lookup helpers are needed here.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
这个提交包含在:
Greg Kroah-Hartman
2019-09-03 17:11:07 +02:00
当前提交 c5c0283a9d
修改 48 个文件,包含 341 行新增383 行删除

查看文件

@@ -85,16 +85,6 @@ enum usb_role usb_role_switch_get_role(struct usb_role_switch *sw)
}
EXPORT_SYMBOL_GPL(usb_role_switch_get_role);
static int switch_fwnode_match(struct device *dev, const void *fwnode)
{
return dev_fwnode(dev) == fwnode;
}
static int switch_name_match(struct device *dev, const void *name)
{
return !strcmp((const char *)name, dev_name(dev));
}
static void *usb_role_switch_match(struct device_connection *con, int ep,
void *data)
{
@@ -104,11 +94,9 @@ static void *usb_role_switch_match(struct device_connection *con, int ep,
if (con->id && !fwnode_property_present(con->fwnode, con->id))
return NULL;
dev = class_find_device(role_class, NULL, con->fwnode,
switch_fwnode_match);
dev = class_find_device_by_fwnode(role_class, con->fwnode);
} else {
dev = class_find_device(role_class, NULL, con->endpoint[ep],
switch_name_match);
dev = class_find_device_by_name(role_class, con->endpoint[ep]);
}
return dev ? to_role_switch(dev) : ERR_PTR(-EPROBE_DEFER);