aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@freescale.com>2013-06-25 05:58:05 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-06-25 19:41:06 -0400
commit046916de1161baa02e29006df38bb09d66385291 (patch)
tree406784c4c2e7bd46d50f77a33981970e079eb317 /drivers/usb
parent1f21569c0ffc83034c1ea023d16c6114a429c131 (diff)
usb: chipidea: ci_hdrc_imx: access phy via private data
commit ea1418b5f1a (usb: chipidea: i.MX: use devm_usb_get_phy_by_phandle to get phy) causes the USB host to miss the disconnect/connect events. In order to reproduce this problem: - Insert a USB thumb into the USB host port (connection is detected) - Remove it (no disconnect event will be reported) - Insert the USB thumb again (connection is not detected) Fix this problem by accessing the usb_phy structure using the private data instead of accessing a local structure. Tested on a mx28evk board. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Acked-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/chipidea/ci_hdrc_imx.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c
index 37fdae5106ae..14362c00db3f 100644
--- a/drivers/usb/chipidea/ci_hdrc_imx.c
+++ b/drivers/usb/chipidea/ci_hdrc_imx.c
@@ -98,7 +98,6 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev)
98 }; 98 };
99 struct resource *res; 99 struct resource *res;
100 int ret; 100 int ret;
101 struct usb_phy *phy;
102 101
103 if (of_find_property(pdev->dev.of_node, "fsl,usbmisc", NULL) 102 if (of_find_property(pdev->dev.of_node, "fsl,usbmisc", NULL)
104 && !usbmisc_ops) 103 && !usbmisc_ops)
@@ -130,14 +129,14 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev)
130 return ret; 129 return ret;
131 } 130 }
132 131
133 phy = devm_usb_get_phy_by_phandle(&pdev->dev, "fsl,usbphy", 0); 132 data->phy = devm_usb_get_phy_by_phandle(&pdev->dev, "fsl,usbphy", 0);
134 if (!IS_ERR(phy)) { 133 if (!IS_ERR(data->phy)) {
135 ret = usb_phy_init(phy); 134 ret = usb_phy_init(data->phy);
136 if (ret) { 135 if (ret) {
137 dev_err(&pdev->dev, "unable to init phy: %d\n", ret); 136 dev_err(&pdev->dev, "unable to init phy: %d\n", ret);
138 goto err_clk; 137 goto err_clk;
139 } 138 }
140 } else if (PTR_ERR(phy) == -EPROBE_DEFER) { 139 } else if (PTR_ERR(data->phy) == -EPROBE_DEFER) {
141 ret = -EPROBE_DEFER; 140 ret = -EPROBE_DEFER;
142 goto err_clk; 141 goto err_clk;
143 } 142 }