diff options
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/common/usb-otg-fsm.c | 2 | ||||
-rw-r--r-- | drivers/usb/core/hcd.c | 17 | ||||
-rw-r--r-- | drivers/usb/dwc3/dwc3-st.c | 6 | ||||
-rw-r--r-- | drivers/usb/host/ehci-st.c | 6 | ||||
-rw-r--r-- | drivers/usb/host/ohci-st.c | 6 |
5 files changed, 21 insertions, 16 deletions
diff --git a/drivers/usb/common/usb-otg-fsm.c b/drivers/usb/common/usb-otg-fsm.c index 9059b7dc185e..2f537bbdda09 100644 --- a/drivers/usb/common/usb-otg-fsm.c +++ b/drivers/usb/common/usb-otg-fsm.c | |||
@@ -21,6 +21,7 @@ | |||
21 | * 675 Mass Ave, Cambridge, MA 02139, USA. | 21 | * 675 Mass Ave, Cambridge, MA 02139, USA. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <linux/module.h> | ||
24 | #include <linux/kernel.h> | 25 | #include <linux/kernel.h> |
25 | #include <linux/types.h> | 26 | #include <linux/types.h> |
26 | #include <linux/mutex.h> | 27 | #include <linux/mutex.h> |
@@ -450,3 +451,4 @@ int otg_statemachine(struct otg_fsm *fsm) | |||
450 | return fsm->state_changed; | 451 | return fsm->state_changed; |
451 | } | 452 | } |
452 | EXPORT_SYMBOL_GPL(otg_statemachine); | 453 | EXPORT_SYMBOL_GPL(otg_statemachine); |
454 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 34b837ae1ed7..d2e3f655c26f 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c | |||
@@ -2598,26 +2598,23 @@ EXPORT_SYMBOL_GPL(usb_create_hcd); | |||
2598 | * Don't deallocate the bandwidth_mutex until the last shared usb_hcd is | 2598 | * Don't deallocate the bandwidth_mutex until the last shared usb_hcd is |
2599 | * deallocated. | 2599 | * deallocated. |
2600 | * | 2600 | * |
2601 | * Make sure to only deallocate the bandwidth_mutex when the primary HCD is | 2601 | * Make sure to deallocate the bandwidth_mutex only when the last HCD is |
2602 | * freed. When hcd_release() is called for either hcd in a peer set | 2602 | * freed. When hcd_release() is called for either hcd in a peer set, |
2603 | * invalidate the peer's ->shared_hcd and ->primary_hcd pointers to | 2603 | * invalidate the peer's ->shared_hcd and ->primary_hcd pointers. |
2604 | * block new peering attempts | ||
2605 | */ | 2604 | */ |
2606 | static void hcd_release(struct kref *kref) | 2605 | static void hcd_release(struct kref *kref) |
2607 | { | 2606 | { |
2608 | struct usb_hcd *hcd = container_of (kref, struct usb_hcd, kref); | 2607 | struct usb_hcd *hcd = container_of (kref, struct usb_hcd, kref); |
2609 | 2608 | ||
2610 | mutex_lock(&usb_port_peer_mutex); | 2609 | mutex_lock(&usb_port_peer_mutex); |
2611 | if (usb_hcd_is_primary_hcd(hcd)) { | ||
2612 | kfree(hcd->address0_mutex); | ||
2613 | kfree(hcd->bandwidth_mutex); | ||
2614 | } | ||
2615 | if (hcd->shared_hcd) { | 2610 | if (hcd->shared_hcd) { |
2616 | struct usb_hcd *peer = hcd->shared_hcd; | 2611 | struct usb_hcd *peer = hcd->shared_hcd; |
2617 | 2612 | ||
2618 | peer->shared_hcd = NULL; | 2613 | peer->shared_hcd = NULL; |
2619 | if (peer->primary_hcd == hcd) | 2614 | peer->primary_hcd = NULL; |
2620 | peer->primary_hcd = NULL; | 2615 | } else { |
2616 | kfree(hcd->address0_mutex); | ||
2617 | kfree(hcd->bandwidth_mutex); | ||
2621 | } | 2618 | } |
2622 | mutex_unlock(&usb_port_peer_mutex); | 2619 | mutex_unlock(&usb_port_peer_mutex); |
2623 | kfree(hcd); | 2620 | kfree(hcd); |
diff --git a/drivers/usb/dwc3/dwc3-st.c b/drivers/usb/dwc3/dwc3-st.c index 50d6ae6f88bc..89a2f712fdfe 100644 --- a/drivers/usb/dwc3/dwc3-st.c +++ b/drivers/usb/dwc3/dwc3-st.c | |||
@@ -233,7 +233,8 @@ static int st_dwc3_probe(struct platform_device *pdev) | |||
233 | dev_vdbg(&pdev->dev, "glue-logic addr 0x%p, syscfg-reg offset 0x%x\n", | 233 | dev_vdbg(&pdev->dev, "glue-logic addr 0x%p, syscfg-reg offset 0x%x\n", |
234 | dwc3_data->glue_base, dwc3_data->syscfg_reg_off); | 234 | dwc3_data->glue_base, dwc3_data->syscfg_reg_off); |
235 | 235 | ||
236 | dwc3_data->rstc_pwrdn = devm_reset_control_get(dev, "powerdown"); | 236 | dwc3_data->rstc_pwrdn = |
237 | devm_reset_control_get_exclusive(dev, "powerdown"); | ||
237 | if (IS_ERR(dwc3_data->rstc_pwrdn)) { | 238 | if (IS_ERR(dwc3_data->rstc_pwrdn)) { |
238 | dev_err(&pdev->dev, "could not get power controller\n"); | 239 | dev_err(&pdev->dev, "could not get power controller\n"); |
239 | ret = PTR_ERR(dwc3_data->rstc_pwrdn); | 240 | ret = PTR_ERR(dwc3_data->rstc_pwrdn); |
@@ -243,7 +244,8 @@ static int st_dwc3_probe(struct platform_device *pdev) | |||
243 | /* Manage PowerDown */ | 244 | /* Manage PowerDown */ |
244 | reset_control_deassert(dwc3_data->rstc_pwrdn); | 245 | reset_control_deassert(dwc3_data->rstc_pwrdn); |
245 | 246 | ||
246 | dwc3_data->rstc_rst = devm_reset_control_get(dev, "softreset"); | 247 | dwc3_data->rstc_rst = |
248 | devm_reset_control_get_shared(dev, "softreset"); | ||
247 | if (IS_ERR(dwc3_data->rstc_rst)) { | 249 | if (IS_ERR(dwc3_data->rstc_rst)) { |
248 | dev_err(&pdev->dev, "could not get reset controller\n"); | 250 | dev_err(&pdev->dev, "could not get reset controller\n"); |
249 | ret = PTR_ERR(dwc3_data->rstc_rst); | 251 | ret = PTR_ERR(dwc3_data->rstc_rst); |
diff --git a/drivers/usb/host/ehci-st.c b/drivers/usb/host/ehci-st.c index a94ed677d937..be4a2788fc58 100644 --- a/drivers/usb/host/ehci-st.c +++ b/drivers/usb/host/ehci-st.c | |||
@@ -206,7 +206,8 @@ static int st_ehci_platform_probe(struct platform_device *dev) | |||
206 | priv->clk48 = NULL; | 206 | priv->clk48 = NULL; |
207 | } | 207 | } |
208 | 208 | ||
209 | priv->pwr = devm_reset_control_get_optional(&dev->dev, "power"); | 209 | priv->pwr = |
210 | devm_reset_control_get_optional_shared(&dev->dev, "power"); | ||
210 | if (IS_ERR(priv->pwr)) { | 211 | if (IS_ERR(priv->pwr)) { |
211 | err = PTR_ERR(priv->pwr); | 212 | err = PTR_ERR(priv->pwr); |
212 | if (err == -EPROBE_DEFER) | 213 | if (err == -EPROBE_DEFER) |
@@ -214,7 +215,8 @@ static int st_ehci_platform_probe(struct platform_device *dev) | |||
214 | priv->pwr = NULL; | 215 | priv->pwr = NULL; |
215 | } | 216 | } |
216 | 217 | ||
217 | priv->rst = devm_reset_control_get_optional(&dev->dev, "softreset"); | 218 | priv->rst = |
219 | devm_reset_control_get_optional_shared(&dev->dev, "softreset"); | ||
218 | if (IS_ERR(priv->rst)) { | 220 | if (IS_ERR(priv->rst)) { |
219 | err = PTR_ERR(priv->rst); | 221 | err = PTR_ERR(priv->rst); |
220 | if (err == -EPROBE_DEFER) | 222 | if (err == -EPROBE_DEFER) |
diff --git a/drivers/usb/host/ohci-st.c b/drivers/usb/host/ohci-st.c index acf2eb2a5676..02816a1515a1 100644 --- a/drivers/usb/host/ohci-st.c +++ b/drivers/usb/host/ohci-st.c | |||
@@ -188,13 +188,15 @@ static int st_ohci_platform_probe(struct platform_device *dev) | |||
188 | priv->clk48 = NULL; | 188 | priv->clk48 = NULL; |
189 | } | 189 | } |
190 | 190 | ||
191 | priv->pwr = devm_reset_control_get_optional(&dev->dev, "power"); | 191 | priv->pwr = |
192 | devm_reset_control_get_optional_shared(&dev->dev, "power"); | ||
192 | if (IS_ERR(priv->pwr)) { | 193 | if (IS_ERR(priv->pwr)) { |
193 | err = PTR_ERR(priv->pwr); | 194 | err = PTR_ERR(priv->pwr); |
194 | goto err_put_clks; | 195 | goto err_put_clks; |
195 | } | 196 | } |
196 | 197 | ||
197 | priv->rst = devm_reset_control_get_optional(&dev->dev, "softreset"); | 198 | priv->rst = |
199 | devm_reset_control_get_optional_shared(&dev->dev, "softreset"); | ||
198 | if (IS_ERR(priv->rst)) { | 200 | if (IS_ERR(priv->rst)) { |
199 | err = PTR_ERR(priv->rst); | 201 | err = PTR_ERR(priv->rst); |
200 | goto err_put_clks; | 202 | goto err_put_clks; |