X-Git-Url: http://git.ozo.com/?a=blobdiff_plain;f=target%2Flinux%2Fgeneric%2Fpatches-3.7%2F820-usb_add_usb_find_device_by_name.patch;h=c77ebd11cac8b1f74d7d051994fe0bf82e51c944;hb=4c043300fc40d06ea07a1fa83691c2bc72bff1e1;hp=dc90e75b8c0691525f9e2222fc6158cf6980b178;hpb=4fa5781a959b0711c5cd8c57a2a55b7ba2528503;p=openwrt%2F.git diff --git a/target/linux/generic/patches-3.7/820-usb_add_usb_find_device_by_name.patch b/target/linux/generic/patches-3.7/820-usb_add_usb_find_device_by_name.patch index dc90e75b8c..c77ebd11ca 100644 --- a/target/linux/generic/patches-3.7/820-usb_add_usb_find_device_by_name.patch +++ b/target/linux/generic/patches-3.7/820-usb_add_usb_find_device_by_name.patch @@ -8,6 +8,7 @@ + const char *name) +{ + struct usb_device *ret_dev = NULL; ++ struct usb_device *childdev = NULL; + int child; + + dev_dbg(&dev->dev, "check for name %s ...\n", name); @@ -18,13 +19,12 @@ + ret_dev = usb_get_dev(dev); + goto exit; + } -+ + /* look through all of the children of this device */ -+ for (child = 0; child < dev->maxchild; ++child) { -+ if (dev->children[child]) { -+ usb_lock_device(dev->children[child]); -+ ret_dev = match_device_name(dev->children[child], name); -+ usb_unlock_device(dev->children[child]); ++ usb_hub_for_each_child(dev, child, childdev) { ++ if (childdev) { ++ usb_lock_device(childdev); ++ ret_dev = match_device_name(childdev, name); ++ usb_unlock_device(childdev); + if (ret_dev) + goto exit; + }