Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 7965
b: refs/heads/master
c: 8b28c75
h: refs/heads/master
i:
  7963: 8b5ba85
v: v3
  • Loading branch information
Alan Stern authored and Greg Kroah-Hartman committed Sep 8, 2005
1 parent 37ca40e commit 641625a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 68a6457edb8a64fdcc231a4fc5406f6e3f6c9b33
refs/heads/master: 8b28c7526a302bbfa618f7eab4ef961edd68c9a0
39 changes: 18 additions & 21 deletions trunk/drivers/usb/core/hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,23 @@ static int hub_hub_status(struct usb_hub *hub,
return ret;
}

static int hub_port_disable(struct usb_hub *hub, int port1, int set_state)
{
struct usb_device *hdev = hub->hdev;
int ret;

if (hdev->children[port1-1] && set_state) {
usb_set_device_state(hdev->children[port1-1],
USB_STATE_NOTATTACHED);
}
ret = clear_port_feature(hdev, port1, USB_PORT_FEAT_ENABLE);
if (ret)
dev_err(hub->intfdev, "cannot disable port %d (err = %d)\n",
port1, ret);

return ret;
}

static int hub_configure(struct usb_hub *hub,
struct usb_endpoint_descriptor *endpoint)
{
Expand Down Expand Up @@ -717,15 +734,12 @@ static void hub_disconnect(struct usb_interface *intf)
struct usb_hub *hub = usb_get_intfdata (intf);
struct usb_device *hdev;

if (!hub)
return;
usb_set_intfdata (intf, NULL);
hdev = hub->hdev;

if (hdev->speed == USB_SPEED_HIGH)
highspeed_hubs--;

usb_set_intfdata (intf, NULL);

hub_quiesce(hub);
usb_free_urb(hub->urb);
hub->urb = NULL;
Expand Down Expand Up @@ -1430,23 +1444,6 @@ static int hub_port_reset(struct usb_hub *hub, int port1,
return status;
}

static int hub_port_disable(struct usb_hub *hub, int port1, int set_state)
{
struct usb_device *hdev = hub->hdev;
int ret;

if (hdev->children[port1-1] && set_state) {
usb_set_device_state(hdev->children[port1-1],
USB_STATE_NOTATTACHED);
}
ret = clear_port_feature(hdev, port1, USB_PORT_FEAT_ENABLE);
if (ret)
dev_err(hub->intfdev, "cannot disable port %d (err = %d)\n",
port1, ret);

return ret;
}

/*
* Disable a port and mark a logical connnect-change event, so that some
* time later khubd will disconnect() any existing usb_device on the port
Expand Down

0 comments on commit 641625a

Please sign in to comment.