|
@@ -186,7 +186,12 @@ static ssize_t rebind_store(struct device_driver *dev, const char *buf,
|
|
|
if (!bid)
|
|
|
return -ENODEV;
|
|
|
|
|
|
+ /* device_attach() callers should hold parent lock for USB */
|
|
|
+ if (bid->udev->dev.parent)
|
|
|
+ device_lock(bid->udev->dev.parent);
|
|
|
ret = device_attach(&bid->udev->dev);
|
|
|
+ if (bid->udev->dev.parent)
|
|
|
+ device_unlock(bid->udev->dev.parent);
|
|
|
if (ret < 0) {
|
|
|
dev_err(&bid->udev->dev, "rebind failed\n");
|
|
|
return ret;
|