Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 354576
b: refs/heads/master
c: fde2638
h: refs/heads/master
v: v3
  • Loading branch information
Lan Tianyu authored and Greg Kroah-Hartman committed Jan 21, 2013
1 parent ac9e4ed commit 964ae8e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cef7468caff29d3333fba4d0ececd82063ce80d5
refs/heads/master: fde26380315d7d57816efc143b7924c82dba764d
26 changes: 26 additions & 0 deletions trunk/drivers/usb/core/hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -1989,6 +1989,14 @@ void usb_disconnect(struct usb_device **pdev)
usb_disable_device(udev, 0);
usb_hcd_synchronize_unlinks(udev);

if (udev->parent) {
struct usb_port *port_dev =
hdev_to_hub(udev->parent)->ports[udev->portnum - 1];

sysfs_remove_link(&udev->dev.kobj, "port");
sysfs_remove_link(&port_dev->dev.kobj, "device");
}

usb_remove_ep_devs(&udev->ep0);
usb_unlock_device(udev);

Expand Down Expand Up @@ -2281,6 +2289,24 @@ int usb_new_device(struct usb_device *udev)
goto fail;
}

/* Create link files between child device and usb port device. */
if (udev->parent) {
struct usb_port *port_dev =
hdev_to_hub(udev->parent)->ports[udev->portnum - 1];

err = sysfs_create_link(&udev->dev.kobj,
&port_dev->dev.kobj, "port");
if (err)
goto fail;

err = sysfs_create_link(&port_dev->dev.kobj,
&udev->dev.kobj, "device");
if (err) {
sysfs_remove_link(&udev->dev.kobj, "port");
goto fail;
}
}

(void) usb_create_ep_devs(&udev->dev, &udev->ep0, udev);
usb_mark_last_busy(udev);
pm_runtime_put_sync_autosuspend(&udev->dev);
Expand Down

0 comments on commit 964ae8e

Please sign in to comment.