aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/hub.c
diff options
context:
space:
mode:
authorXenia Ragiadakou <burzalodowa@gmail.com>2013-08-31 11:09:12 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-09-17 12:49:24 -0400
commit9df89d85b407690afa46ddfbccc80bec6869971d (patch)
tree7e35884e7fdd3202e9f6b73729496adc72267a0b /drivers/usb/core/hub.c
parent6c74dada4f5a37037dee1da6a8a7aeb56c558bca (diff)
usbcore: set lpm_capable field for LPM capable root hubs
This patch sets the lpm_capable field for root hubs with LPM capabilities. Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com> Reported-by: Martin MOKREJS <mmokrejs@gmail.com> Suggested-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/core/hub.c')
-rw-r--r--drivers/usb/core/hub.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index dde4c83516a1..52a1de99c6f2 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -135,7 +135,7 @@ struct usb_hub *usb_hub_to_struct_hub(struct usb_device *hdev)
135 return usb_get_intfdata(hdev->actconfig->interface[0]); 135 return usb_get_intfdata(hdev->actconfig->interface[0]);
136} 136}
137 137
138static int usb_device_supports_lpm(struct usb_device *udev) 138int usb_device_supports_lpm(struct usb_device *udev)
139{ 139{
140 /* USB 2.1 (and greater) devices indicate LPM support through 140 /* USB 2.1 (and greater) devices indicate LPM support through
141 * their USB 2.0 Extended Capabilities BOS descriptor. 141 * their USB 2.0 Extended Capabilities BOS descriptor.
@@ -156,6 +156,11 @@ static int usb_device_supports_lpm(struct usb_device *udev)
156 "Power management will be impacted.\n"); 156 "Power management will be impacted.\n");
157 return 0; 157 return 0;
158 } 158 }
159
160 /* udev is root hub */
161 if (!udev->parent)
162 return 1;
163
159 if (udev->parent->lpm_capable) 164 if (udev->parent->lpm_capable)
160 return 1; 165 return 1;
161 166