aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-12-14 17:57:16 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-14 17:57:16 -0500
commite7cf773d431a63a2417902696fcc9e0ebdc83bbe (patch)
tree86dbdceb7d91226507a3af0d57e03b0ca664b22e /drivers/usb/core
parent7a02d089695a1217992434f03a78aa32bad85b5c (diff)
parent81e1dadfb5b2d47aa513ad60b1c9cf0ea17b6514 (diff)
Merge tag 'usb-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB updates from Greg KH: "Here's the big set of USB and PHY patches for 3.19-rc1. The normal churn in the USB gadget area is in here, as well as xhci and other individual USB driver updates. The PHY tree is also in here, as there were dependancies on the USB tree. All of these have been in linux-next" * tag 'usb-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (351 commits) arm: omap3: twl: remove usb phy init data usbip: fix error handling in stub_probe() usb: gadget: udc: missing curly braces USB: mos7720: delete some unneeded code wusb: replace memset by memzero_explicit usbip: remove unneeded structure usb: xhci: fix comment for PORT_DEV_REMOVE xhci: don't use the same variable for stopped and halted rings current TD xhci: clear extra bits from slot context when setting max exit latency xhci: cleanup finish_td function USB: adutux: NULL dereferences on disconnect usb: chipidea: fix platform_no_drv_owner.cocci warnings usb: chipidea: Fixed a few typos in comments Documentation: bindings: add doc for the USB2 ChipIdea USB driver usb: chipidea: add a usb2 driver for ci13xxx usb: chipidea: fix phy handling usb: chipidea: remove duplicate dev_set_drvdata for host_start usb: chipidea: parameter 'mode' isn't needed for hw_device_reset usb: chipidea: add controller reset API usb: chipidea: remove flag CI_HDRC_REQUIRE_TRANSCEIVER ...
Diffstat (limited to 'drivers/usb/core')
-rw-r--r--drivers/usb/core/hcd.c7
-rw-r--r--drivers/usb/core/hub.c18
2 files changed, 12 insertions, 13 deletions
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index 278be0515e8e..11cee55ae397 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -2646,7 +2646,7 @@ int usb_add_hcd(struct usb_hcd *hcd,
2646 } 2646 }
2647 } 2647 }
2648 2648
2649 if (IS_ENABLED(CONFIG_GENERIC_PHY)) { 2649 if (IS_ENABLED(CONFIG_GENERIC_PHY) && !hcd->phy) {
2650 struct phy *phy = phy_get(hcd->self.controller, "usb"); 2650 struct phy *phy = phy_get(hcd->self.controller, "usb");
2651 2651
2652 if (IS_ERR(phy)) { 2652 if (IS_ERR(phy)) {
@@ -2666,6 +2666,7 @@ int usb_add_hcd(struct usb_hcd *hcd,
2666 goto err_phy; 2666 goto err_phy;
2667 } 2667 }
2668 hcd->phy = phy; 2668 hcd->phy = phy;
2669 hcd->remove_phy = 1;
2669 } 2670 }
2670 } 2671 }
2671 2672
@@ -2812,7 +2813,7 @@ err_allocate_root_hub:
2812err_register_bus: 2813err_register_bus:
2813 hcd_buffer_destroy(hcd); 2814 hcd_buffer_destroy(hcd);
2814err_create_buf: 2815err_create_buf:
2815 if (IS_ENABLED(CONFIG_GENERIC_PHY) && hcd->phy) { 2816 if (IS_ENABLED(CONFIG_GENERIC_PHY) && hcd->remove_phy && hcd->phy) {
2816 phy_power_off(hcd->phy); 2817 phy_power_off(hcd->phy);
2817 phy_exit(hcd->phy); 2818 phy_exit(hcd->phy);
2818 phy_put(hcd->phy); 2819 phy_put(hcd->phy);
@@ -2896,7 +2897,7 @@ void usb_remove_hcd(struct usb_hcd *hcd)
2896 usb_deregister_bus(&hcd->self); 2897 usb_deregister_bus(&hcd->self);
2897 hcd_buffer_destroy(hcd); 2898 hcd_buffer_destroy(hcd);
2898 2899
2899 if (IS_ENABLED(CONFIG_GENERIC_PHY) && hcd->phy) { 2900 if (IS_ENABLED(CONFIG_GENERIC_PHY) && hcd->remove_phy && hcd->phy) {
2900 phy_power_off(hcd->phy); 2901 phy_power_off(hcd->phy);
2901 phy_exit(hcd->phy); 2902 phy_exit(hcd->phy);
2902 phy_put(hcd->phy); 2903 phy_put(hcd->phy);
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index c9596525ba8c..aeb50bb6ba9c 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -2543,11 +2543,14 @@ int usb_authorize_device(struct usb_device *usb_dev)
2543 "can't autoresume for authorization: %d\n", result); 2543 "can't autoresume for authorization: %d\n", result);
2544 goto error_autoresume; 2544 goto error_autoresume;
2545 } 2545 }
2546 result = usb_get_device_descriptor(usb_dev, sizeof(usb_dev->descriptor)); 2546
2547 if (result < 0) { 2547 if (usb_dev->wusb) {
2548 dev_err(&usb_dev->dev, "can't re-read device descriptor for " 2548 result = usb_get_device_descriptor(usb_dev, sizeof(usb_dev->descriptor));
2549 "authorization: %d\n", result); 2549 if (result < 0) {
2550 goto error_device_descriptor; 2550 dev_err(&usb_dev->dev, "can't re-read device descriptor for "
2551 "authorization: %d\n", result);
2552 goto error_device_descriptor;
2553 }
2551 } 2554 }
2552 2555
2553 usb_dev->authorized = 1; 2556 usb_dev->authorized = 1;
@@ -3907,14 +3910,9 @@ static void usb_enable_link_state(struct usb_hcd *hcd, struct usb_device *udev,
3907static int usb_disable_link_state(struct usb_hcd *hcd, struct usb_device *udev, 3910static int usb_disable_link_state(struct usb_hcd *hcd, struct usb_device *udev,
3908 enum usb3_link_state state) 3911 enum usb3_link_state state)
3909{ 3912{
3910 int feature;
3911
3912 switch (state) { 3913 switch (state) {
3913 case USB3_LPM_U1: 3914 case USB3_LPM_U1:
3914 feature = USB_PORT_FEAT_U1_TIMEOUT;
3915 break;
3916 case USB3_LPM_U2: 3915 case USB3_LPM_U2:
3917 feature = USB_PORT_FEAT_U2_TIMEOUT;
3918 break; 3916 break;
3919 default: 3917 default:
3920 dev_warn(&udev->dev, "%s: Can't disable non-U1 or U2 state.\n", 3918 dev_warn(&udev->dev, "%s: Can't disable non-U1 or U2 state.\n",