Commit 9b510df7 authored by Hans de Goede's avatar Hans de Goede Committed by Simon Glass
Browse files

dm: usb: Rename usb_find_child to usb_find_emul_child

Now that we unbind usb devices from usb_stop() usb_find_child() is
only necessary to deal with emulated usb devices.

Rename it to make this clear and add a #ifdef to make it a nop in
other cases.

Note the #ifdef turns usb_find_emul_child() into a nop, rather then not
building it and adding another #ifdef to the caller, this is done this way
because adding a #ifdef to the caller is somewhat hairy.
Signed-off-by: default avatarHans de Goede <>
Acked-by: Simon Glass's avatarSimon Glass <>
parent 6cda3695
......@@ -485,15 +485,14 @@ error:
* usb_find_child() - Find an existing device which matches our needs
* usb_find_emul_child() - Find an existing device for emulated devices
static int usb_find_child(struct udevice *parent,
struct usb_device_descriptor *desc,
struct usb_interface_descriptor *iface,
struct udevice **devp)
static int usb_find_emul_child(struct udevice *parent,
struct usb_device_descriptor *desc,
struct usb_interface_descriptor *iface,
struct udevice **devp)
struct udevice *dev;
*devp = NULL;
......@@ -512,7 +511,7 @@ static int usb_find_child(struct udevice *parent,
return 0;
return -ENOENT;
......@@ -572,8 +571,8 @@ int usb_scan_device(struct udevice *parent, int port,
debug("read_descriptor for '%s': ret=%d\n", parent->name, ret);
if (ret)
return ret;
ret = usb_find_child(parent, &udev->descriptor, iface, &dev);
debug("** usb_find_child returns %d\n", ret);
ret = usb_find_emul_child(parent, &udev->descriptor, iface, &dev);
debug("** usb_find_emul_child returns %d\n", ret);
if (ret) {
if (ret != -ENOENT)
return ret;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment