diff options
Diffstat (limited to 'drivers/usb')
29 files changed, 89 insertions, 90 deletions
diff --git a/drivers/usb/c67x00/c67x00-sched.c b/drivers/usb/c67x00/c67x00-sched.c index aa491627a45b..892cc96466eb 100644 --- a/drivers/usb/c67x00/c67x00-sched.c +++ b/drivers/usb/c67x00/c67x00-sched.c | |||
@@ -344,7 +344,7 @@ void c67x00_endpoint_disable(struct usb_hcd *hcd, struct usb_host_endpoint *ep) | |||
344 | /* it could happen that we reinitialize this completion, while | 344 | /* it could happen that we reinitialize this completion, while |
345 | * somebody was waiting for that completion. The timeout and | 345 | * somebody was waiting for that completion. The timeout and |
346 | * while loop handle such cases, but this might be improved */ | 346 | * while loop handle such cases, but this might be improved */ |
347 | INIT_COMPLETION(c67x00->endpoint_disable); | 347 | reinit_completion(&c67x00->endpoint_disable); |
348 | c67x00_sched_kick(c67x00); | 348 | c67x00_sched_kick(c67x00); |
349 | wait_for_completion_timeout(&c67x00->endpoint_disable, 1 * HZ); | 349 | wait_for_completion_timeout(&c67x00->endpoint_disable, 1 * HZ); |
350 | 350 | ||
diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c index 023d3cb6aa0a..bb5d976e5b81 100644 --- a/drivers/usb/chipidea/ci_hdrc_imx.c +++ b/drivers/usb/chipidea/ci_hdrc_imx.c | |||
@@ -115,10 +115,9 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev) | |||
115 | 115 | ||
116 | pdata.phy = data->phy; | 116 | pdata.phy = data->phy; |
117 | 117 | ||
118 | if (!pdev->dev.dma_mask) | 118 | ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); |
119 | pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; | 119 | if (ret) |
120 | if (!pdev->dev.coherent_dma_mask) | 120 | goto err_clk; |
121 | pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); | ||
122 | 121 | ||
123 | if (data->usbmisc_data) { | 122 | if (data->usbmisc_data) { |
124 | ret = imx_usbmisc_init(data->usbmisc_data); | 123 | ret = imx_usbmisc_init(data->usbmisc_data); |
diff --git a/drivers/usb/core/Kconfig b/drivers/usb/core/Kconfig index db535b0aa172..fed7f68d025d 100644 --- a/drivers/usb/core/Kconfig +++ b/drivers/usb/core/Kconfig | |||
@@ -28,7 +28,7 @@ config USB_DEFAULT_PERSIST | |||
28 | bool "Enable USB persist by default" | 28 | bool "Enable USB persist by default" |
29 | default y | 29 | default y |
30 | help | 30 | help |
31 | Say N here if you don't want USB power session persistance | 31 | Say N here if you don't want USB power session persistence |
32 | enabled by default. If you say N it will make suspended USB | 32 | enabled by default. If you say N it will make suspended USB |
33 | devices that lose power get reenumerated as if they had been | 33 | devices that lose power get reenumerated as if they had been |
34 | unplugged, causing any mounted filesystems to be lost. The | 34 | unplugged, causing any mounted filesystems to be lost. The |
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 06cec635e703..a7c04e24ca48 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -5501,6 +5501,6 @@ acpi_handle usb_get_hub_port_acpi_handle(struct usb_device *hdev, | |||
5501 | if (!hub) | 5501 | if (!hub) |
5502 | return NULL; | 5502 | return NULL; |
5503 | 5503 | ||
5504 | return DEVICE_ACPI_HANDLE(&hub->ports[port1 - 1]->dev); | 5504 | return ACPI_HANDLE(&hub->ports[port1 - 1]->dev); |
5505 | } | 5505 | } |
5506 | #endif | 5506 | #endif |
diff --git a/drivers/usb/core/usb-acpi.c b/drivers/usb/core/usb-acpi.c index 255c14464bf2..4e243c37f17f 100644 --- a/drivers/usb/core/usb-acpi.c +++ b/drivers/usb/core/usb-acpi.c | |||
@@ -173,7 +173,7 @@ static int usb_acpi_find_device(struct device *dev, acpi_handle *handle) | |||
173 | } | 173 | } |
174 | 174 | ||
175 | /* root hub's parent is the usb hcd. */ | 175 | /* root hub's parent is the usb hcd. */ |
176 | parent_handle = DEVICE_ACPI_HANDLE(dev->parent); | 176 | parent_handle = ACPI_HANDLE(dev->parent); |
177 | *handle = acpi_get_child(parent_handle, udev->portnum); | 177 | *handle = acpi_get_child(parent_handle, udev->portnum); |
178 | if (!*handle) | 178 | if (!*handle) |
179 | return -ENODEV; | 179 | return -ENODEV; |
@@ -194,7 +194,7 @@ static int usb_acpi_find_device(struct device *dev, acpi_handle *handle) | |||
194 | 194 | ||
195 | raw_port_num = usb_hcd_find_raw_port_number(hcd, | 195 | raw_port_num = usb_hcd_find_raw_port_number(hcd, |
196 | port_num); | 196 | port_num); |
197 | *handle = acpi_get_child(DEVICE_ACPI_HANDLE(&udev->dev), | 197 | *handle = acpi_get_child(ACPI_HANDLE(&udev->dev), |
198 | raw_port_num); | 198 | raw_port_num); |
199 | if (!*handle) | 199 | if (!*handle) |
200 | return -ENODEV; | 200 | return -ENODEV; |
diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c index 2f2e88a3a11a..8b20c70d91e7 100644 --- a/drivers/usb/dwc3/dwc3-exynos.c +++ b/drivers/usb/dwc3/dwc3-exynos.c | |||
@@ -119,10 +119,9 @@ static int dwc3_exynos_probe(struct platform_device *pdev) | |||
119 | * Since shared usb code relies on it, set it here for now. | 119 | * Since shared usb code relies on it, set it here for now. |
120 | * Once we move to full device tree support this will vanish off. | 120 | * Once we move to full device tree support this will vanish off. |
121 | */ | 121 | */ |
122 | if (!dev->dma_mask) | 122 | ret = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(32)); |
123 | dev->dma_mask = &dev->coherent_dma_mask; | 123 | if (ret) |
124 | if (!dev->coherent_dma_mask) | 124 | goto err1; |
125 | dev->coherent_dma_mask = DMA_BIT_MASK(32); | ||
126 | 125 | ||
127 | platform_set_drvdata(pdev, exynos); | 126 | platform_set_drvdata(pdev, exynos); |
128 | 127 | ||
diff --git a/drivers/usb/gadget/f_fs.c b/drivers/usb/gadget/f_fs.c index 44cf775a8627..774e8b89cdb5 100644 --- a/drivers/usb/gadget/f_fs.c +++ b/drivers/usb/gadget/f_fs.c | |||
@@ -373,7 +373,7 @@ static int __ffs_ep0_queue_wait(struct ffs_data *ffs, char *data, size_t len) | |||
373 | if (req->buf == NULL) | 373 | if (req->buf == NULL) |
374 | req->buf = (void *)0xDEADBABE; | 374 | req->buf = (void *)0xDEADBABE; |
375 | 375 | ||
376 | INIT_COMPLETION(ffs->ep0req_completion); | 376 | reinit_completion(&ffs->ep0req_completion); |
377 | 377 | ||
378 | ret = usb_ep_queue(ffs->gadget->ep0, req, GFP_ATOMIC); | 378 | ret = usb_ep_queue(ffs->gadget->ep0, req, GFP_ATOMIC); |
379 | if (unlikely(ret < 0)) | 379 | if (unlikely(ret < 0)) |
diff --git a/drivers/usb/gadget/lpc32xx_udc.c b/drivers/usb/gadget/lpc32xx_udc.c index 67128be1e1b7..6a2a65aa0057 100644 --- a/drivers/usb/gadget/lpc32xx_udc.c +++ b/drivers/usb/gadget/lpc32xx_udc.c | |||
@@ -3078,7 +3078,9 @@ static int __init lpc32xx_udc_probe(struct platform_device *pdev) | |||
3078 | udc->isp1301_i2c_client->addr); | 3078 | udc->isp1301_i2c_client->addr); |
3079 | 3079 | ||
3080 | pdev->dev.dma_mask = &lpc32xx_usbd_dmamask; | 3080 | pdev->dev.dma_mask = &lpc32xx_usbd_dmamask; |
3081 | pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); | 3081 | retval = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); |
3082 | if (retval) | ||
3083 | goto resource_fail; | ||
3082 | 3084 | ||
3083 | udc->board = &lpc32xx_usbddata; | 3085 | udc->board = &lpc32xx_usbddata; |
3084 | 3086 | ||
diff --git a/drivers/usb/gadget/tcm_usb_gadget.c b/drivers/usb/gadget/tcm_usb_gadget.c index eccea1df702d..6c3d7950d2a9 100644 --- a/drivers/usb/gadget/tcm_usb_gadget.c +++ b/drivers/usb/gadget/tcm_usb_gadget.c | |||
@@ -1923,15 +1923,15 @@ static int usbg_register_configfs(void) | |||
1923 | } | 1923 | } |
1924 | 1924 | ||
1925 | fabric->tf_ops = usbg_ops; | 1925 | fabric->tf_ops = usbg_ops; |
1926 | TF_CIT_TMPL(fabric)->tfc_wwn_cit.ct_attrs = usbg_wwn_attrs; | 1926 | fabric->tf_cit_tmpl.tfc_wwn_cit.ct_attrs = usbg_wwn_attrs; |
1927 | TF_CIT_TMPL(fabric)->tfc_tpg_base_cit.ct_attrs = usbg_base_attrs; | 1927 | fabric->tf_cit_tmpl.tfc_tpg_base_cit.ct_attrs = usbg_base_attrs; |
1928 | TF_CIT_TMPL(fabric)->tfc_tpg_attrib_cit.ct_attrs = NULL; | 1928 | fabric->tf_cit_tmpl.tfc_tpg_attrib_cit.ct_attrs = NULL; |
1929 | TF_CIT_TMPL(fabric)->tfc_tpg_param_cit.ct_attrs = NULL; | 1929 | fabric->tf_cit_tmpl.tfc_tpg_param_cit.ct_attrs = NULL; |
1930 | TF_CIT_TMPL(fabric)->tfc_tpg_np_base_cit.ct_attrs = NULL; | 1930 | fabric->tf_cit_tmpl.tfc_tpg_np_base_cit.ct_attrs = NULL; |
1931 | TF_CIT_TMPL(fabric)->tfc_tpg_nacl_base_cit.ct_attrs = NULL; | 1931 | fabric->tf_cit_tmpl.tfc_tpg_nacl_base_cit.ct_attrs = NULL; |
1932 | TF_CIT_TMPL(fabric)->tfc_tpg_nacl_attrib_cit.ct_attrs = NULL; | 1932 | fabric->tf_cit_tmpl.tfc_tpg_nacl_attrib_cit.ct_attrs = NULL; |
1933 | TF_CIT_TMPL(fabric)->tfc_tpg_nacl_auth_cit.ct_attrs = NULL; | 1933 | fabric->tf_cit_tmpl.tfc_tpg_nacl_auth_cit.ct_attrs = NULL; |
1934 | TF_CIT_TMPL(fabric)->tfc_tpg_nacl_param_cit.ct_attrs = NULL; | 1934 | fabric->tf_cit_tmpl.tfc_tpg_nacl_param_cit.ct_attrs = NULL; |
1935 | ret = target_fabric_configfs_register(fabric); | 1935 | ret = target_fabric_configfs_register(fabric); |
1936 | if (ret < 0) { | 1936 | if (ret < 0) { |
1937 | printk(KERN_ERR "target_fabric_configfs_register() failed" | 1937 | printk(KERN_ERR "target_fabric_configfs_register() failed" |
diff --git a/drivers/usb/host/bcma-hcd.c b/drivers/usb/host/bcma-hcd.c index df13d425e9c5..205f4a336583 100644 --- a/drivers/usb/host/bcma-hcd.c +++ b/drivers/usb/host/bcma-hcd.c | |||
@@ -227,8 +227,7 @@ static int bcma_hcd_probe(struct bcma_device *dev) | |||
227 | 227 | ||
228 | /* TODO: Probably need checks here; is the core connected? */ | 228 | /* TODO: Probably need checks here; is the core connected? */ |
229 | 229 | ||
230 | if (dma_set_mask(dev->dma_dev, DMA_BIT_MASK(32)) || | 230 | if (dma_set_mask_and_coherent(dev->dma_dev, DMA_BIT_MASK(32))) |
231 | dma_set_coherent_mask(dev->dma_dev, DMA_BIT_MASK(32))) | ||
232 | return -EOPNOTSUPP; | 231 | return -EOPNOTSUPP; |
233 | 232 | ||
234 | usb_dev = kzalloc(sizeof(struct bcma_hcd_device), GFP_KERNEL); | 233 | usb_dev = kzalloc(sizeof(struct bcma_hcd_device), GFP_KERNEL); |
diff --git a/drivers/usb/host/ehci-atmel.c b/drivers/usb/host/ehci-atmel.c index f417526fb1f4..284f8417eae5 100644 --- a/drivers/usb/host/ehci-atmel.c +++ b/drivers/usb/host/ehci-atmel.c | |||
@@ -96,10 +96,9 @@ static int ehci_atmel_drv_probe(struct platform_device *pdev) | |||
96 | * Since shared usb code relies on it, set it here for now. | 96 | * Since shared usb code relies on it, set it here for now. |
97 | * Once we have dma capability bindings this can go away. | 97 | * Once we have dma capability bindings this can go away. |
98 | */ | 98 | */ |
99 | if (!pdev->dev.dma_mask) | 99 | retval = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); |
100 | pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; | 100 | if (retval) |
101 | if (!pdev->dev.coherent_dma_mask) | 101 | goto fail_create_hcd; |
102 | pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); | ||
103 | 102 | ||
104 | hcd = usb_create_hcd(driver, &pdev->dev, dev_name(&pdev->dev)); | 103 | hcd = usb_create_hcd(driver, &pdev->dev, dev_name(&pdev->dev)); |
105 | if (!hcd) { | 104 | if (!hcd) { |
diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c index 016352e0f5a7..e97c198e052f 100644 --- a/drivers/usb/host/ehci-exynos.c +++ b/drivers/usb/host/ehci-exynos.c | |||
@@ -84,10 +84,9 @@ static int exynos_ehci_probe(struct platform_device *pdev) | |||
84 | * Since shared usb code relies on it, set it here for now. | 84 | * Since shared usb code relies on it, set it here for now. |
85 | * Once we move to full device tree support this will vanish off. | 85 | * Once we move to full device tree support this will vanish off. |
86 | */ | 86 | */ |
87 | if (!pdev->dev.dma_mask) | 87 | err = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); |
88 | pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; | 88 | if (err) |
89 | if (!pdev->dev.coherent_dma_mask) | 89 | return err; |
90 | pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); | ||
91 | 90 | ||
92 | exynos_setup_vbus_gpio(pdev); | 91 | exynos_setup_vbus_gpio(pdev); |
93 | 92 | ||
diff --git a/drivers/usb/host/ehci-octeon.c b/drivers/usb/host/ehci-octeon.c index ab0397e4d8f3..4c528b2c033a 100644 --- a/drivers/usb/host/ehci-octeon.c +++ b/drivers/usb/host/ehci-octeon.c | |||
@@ -116,8 +116,10 @@ static int ehci_octeon_drv_probe(struct platform_device *pdev) | |||
116 | * We can DMA from anywhere. But the descriptors must be in | 116 | * We can DMA from anywhere. But the descriptors must be in |
117 | * the lower 4GB. | 117 | * the lower 4GB. |
118 | */ | 118 | */ |
119 | pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); | ||
120 | pdev->dev.dma_mask = &ehci_octeon_dma_mask; | 119 | pdev->dev.dma_mask = &ehci_octeon_dma_mask; |
120 | ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); | ||
121 | if (ret) | ||
122 | return ret; | ||
121 | 123 | ||
122 | hcd = usb_create_hcd(&ehci_octeon_hc_driver, &pdev->dev, "octeon"); | 124 | hcd = usb_create_hcd(&ehci_octeon_hc_driver, &pdev->dev, "octeon"); |
123 | if (!hcd) | 125 | if (!hcd) |
diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c index 78b01fa475bb..6fa82d6b7661 100644 --- a/drivers/usb/host/ehci-omap.c +++ b/drivers/usb/host/ehci-omap.c | |||
@@ -104,7 +104,7 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) | |||
104 | struct resource *res; | 104 | struct resource *res; |
105 | struct usb_hcd *hcd; | 105 | struct usb_hcd *hcd; |
106 | void __iomem *regs; | 106 | void __iomem *regs; |
107 | int ret = -ENODEV; | 107 | int ret; |
108 | int irq; | 108 | int irq; |
109 | int i; | 109 | int i; |
110 | struct omap_hcd *omap; | 110 | struct omap_hcd *omap; |
@@ -144,11 +144,11 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) | |||
144 | * Since shared usb code relies on it, set it here for now. | 144 | * Since shared usb code relies on it, set it here for now. |
145 | * Once we have dma capability bindings this can go away. | 145 | * Once we have dma capability bindings this can go away. |
146 | */ | 146 | */ |
147 | if (!dev->dma_mask) | 147 | ret = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(32)); |
148 | dev->dma_mask = &dev->coherent_dma_mask; | 148 | if (ret) |
149 | if (!dev->coherent_dma_mask) | 149 | return ret; |
150 | dev->coherent_dma_mask = DMA_BIT_MASK(32); | ||
151 | 150 | ||
151 | ret = -ENODEV; | ||
152 | hcd = usb_create_hcd(&ehci_omap_hc_driver, dev, | 152 | hcd = usb_create_hcd(&ehci_omap_hc_driver, dev, |
153 | dev_name(dev)); | 153 | dev_name(dev)); |
154 | if (!hcd) { | 154 | if (!hcd) { |
diff --git a/drivers/usb/host/ehci-orion.c b/drivers/usb/host/ehci-orion.c index d1dfb9db5b42..2ba76730e650 100644 --- a/drivers/usb/host/ehci-orion.c +++ b/drivers/usb/host/ehci-orion.c | |||
@@ -180,10 +180,9 @@ static int ehci_orion_drv_probe(struct platform_device *pdev) | |||
180 | * set. Since shared usb code relies on it, set it here for | 180 | * set. Since shared usb code relies on it, set it here for |
181 | * now. Once we have dma capability bindings this can go away. | 181 | * now. Once we have dma capability bindings this can go away. |
182 | */ | 182 | */ |
183 | if (!pdev->dev.dma_mask) | 183 | err = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); |
184 | pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; | 184 | if (err) |
185 | if (!pdev->dev.coherent_dma_mask) | 185 | goto err1; |
186 | pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); | ||
187 | 186 | ||
188 | if (!request_mem_region(res->start, resource_size(res), | 187 | if (!request_mem_region(res->start, resource_size(res), |
189 | ehci_orion_hc_driver.description)) { | 188 | ehci_orion_hc_driver.description)) { |
diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c index f6b790ca8cf2..7f30b7168d5a 100644 --- a/drivers/usb/host/ehci-platform.c +++ b/drivers/usb/host/ehci-platform.c | |||
@@ -78,7 +78,7 @@ static int ehci_platform_probe(struct platform_device *dev) | |||
78 | struct resource *res_mem; | 78 | struct resource *res_mem; |
79 | struct usb_ehci_pdata *pdata; | 79 | struct usb_ehci_pdata *pdata; |
80 | int irq; | 80 | int irq; |
81 | int err = -ENOMEM; | 81 | int err; |
82 | 82 | ||
83 | if (usb_disabled()) | 83 | if (usb_disabled()) |
84 | return -ENODEV; | 84 | return -ENODEV; |
@@ -89,10 +89,10 @@ static int ehci_platform_probe(struct platform_device *dev) | |||
89 | */ | 89 | */ |
90 | if (!dev_get_platdata(&dev->dev)) | 90 | if (!dev_get_platdata(&dev->dev)) |
91 | dev->dev.platform_data = &ehci_platform_defaults; | 91 | dev->dev.platform_data = &ehci_platform_defaults; |
92 | if (!dev->dev.dma_mask) | 92 | |
93 | dev->dev.dma_mask = &dev->dev.coherent_dma_mask; | 93 | err = dma_coerce_mask_and_coherent(&dev->dev, DMA_BIT_MASK(32)); |
94 | if (!dev->dev.coherent_dma_mask) | 94 | if (err) |
95 | dev->dev.coherent_dma_mask = DMA_BIT_MASK(32); | 95 | return err; |
96 | 96 | ||
97 | pdata = dev_get_platdata(&dev->dev); | 97 | pdata = dev_get_platdata(&dev->dev); |
98 | 98 | ||
diff --git a/drivers/usb/host/ehci-spear.c b/drivers/usb/host/ehci-spear.c index 1cf0adba3fc8..ee6f9ffaa0e7 100644 --- a/drivers/usb/host/ehci-spear.c +++ b/drivers/usb/host/ehci-spear.c | |||
@@ -81,10 +81,9 @@ static int spear_ehci_hcd_drv_probe(struct platform_device *pdev) | |||
81 | * Since shared usb code relies on it, set it here for now. | 81 | * Since shared usb code relies on it, set it here for now. |
82 | * Once we have dma capability bindings this can go away. | 82 | * Once we have dma capability bindings this can go away. |
83 | */ | 83 | */ |
84 | if (!pdev->dev.dma_mask) | 84 | retval = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); |
85 | pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; | 85 | if (retval) |
86 | if (!pdev->dev.coherent_dma_mask) | 86 | goto fail; |
87 | pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); | ||
88 | 87 | ||
89 | usbh_clk = devm_clk_get(&pdev->dev, NULL); | 88 | usbh_clk = devm_clk_get(&pdev->dev, NULL); |
90 | if (IS_ERR(usbh_clk)) { | 89 | if (IS_ERR(usbh_clk)) { |
diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c index e6d8e26e48cc..b9fd0396011e 100644 --- a/drivers/usb/host/ehci-tegra.c +++ b/drivers/usb/host/ehci-tegra.c | |||
@@ -362,10 +362,9 @@ static int tegra_ehci_probe(struct platform_device *pdev) | |||
362 | * Since shared usb code relies on it, set it here for now. | 362 | * Since shared usb code relies on it, set it here for now. |
363 | * Once we have dma capability bindings this can go away. | 363 | * Once we have dma capability bindings this can go away. |
364 | */ | 364 | */ |
365 | if (!pdev->dev.dma_mask) | 365 | err = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); |
366 | pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; | 366 | if (err) |
367 | if (!pdev->dev.coherent_dma_mask) | 367 | return err; |
368 | pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); | ||
369 | 368 | ||
370 | hcd = usb_create_hcd(&tegra_ehci_hc_driver, &pdev->dev, | 369 | hcd = usb_create_hcd(&tegra_ehci_hc_driver, &pdev->dev, |
371 | dev_name(&pdev->dev)); | 370 | dev_name(&pdev->dev)); |
diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c index 476b5a5baf25..418444ebb1b8 100644 --- a/drivers/usb/host/ohci-at91.c +++ b/drivers/usb/host/ohci-at91.c | |||
@@ -469,7 +469,7 @@ MODULE_DEVICE_TABLE(of, at91_ohci_dt_ids); | |||
469 | static int ohci_at91_of_init(struct platform_device *pdev) | 469 | static int ohci_at91_of_init(struct platform_device *pdev) |
470 | { | 470 | { |
471 | struct device_node *np = pdev->dev.of_node; | 471 | struct device_node *np = pdev->dev.of_node; |
472 | int i, gpio; | 472 | int i, gpio, ret; |
473 | enum of_gpio_flags flags; | 473 | enum of_gpio_flags flags; |
474 | struct at91_usbh_data *pdata; | 474 | struct at91_usbh_data *pdata; |
475 | u32 ports; | 475 | u32 ports; |
@@ -481,10 +481,9 @@ static int ohci_at91_of_init(struct platform_device *pdev) | |||
481 | * Since shared usb code relies on it, set it here for now. | 481 | * Since shared usb code relies on it, set it here for now. |
482 | * Once we have dma capability bindings this can go away. | 482 | * Once we have dma capability bindings this can go away. |
483 | */ | 483 | */ |
484 | if (!pdev->dev.dma_mask) | 484 | ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); |
485 | pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; | 485 | if (ret) |
486 | if (!pdev->dev.coherent_dma_mask) | 486 | return ret; |
487 | pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); | ||
488 | 487 | ||
489 | pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); | 488 | pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); |
490 | if (!pdata) | 489 | if (!pdata) |
diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c index a87baedc0aa7..91ec9b2cd378 100644 --- a/drivers/usb/host/ohci-exynos.c +++ b/drivers/usb/host/ohci-exynos.c | |||
@@ -71,10 +71,9 @@ static int exynos_ohci_probe(struct platform_device *pdev) | |||
71 | * Since shared usb code relies on it, set it here for now. | 71 | * Since shared usb code relies on it, set it here for now. |
72 | * Once we move to full device tree support this will vanish off. | 72 | * Once we move to full device tree support this will vanish off. |
73 | */ | 73 | */ |
74 | if (!pdev->dev.dma_mask) | 74 | err = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); |
75 | pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; | 75 | if (err) |
76 | if (!pdev->dev.coherent_dma_mask) | 76 | return err; |
77 | pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); | ||
78 | 77 | ||
79 | hcd = usb_create_hcd(&exynos_ohci_hc_driver, | 78 | hcd = usb_create_hcd(&exynos_ohci_hc_driver, |
80 | &pdev->dev, dev_name(&pdev->dev)); | 79 | &pdev->dev, dev_name(&pdev->dev)); |
diff --git a/drivers/usb/host/ohci-nxp.c b/drivers/usb/host/ohci-nxp.c index 9ab7e24ba65d..e99db8a6d55f 100644 --- a/drivers/usb/host/ohci-nxp.c +++ b/drivers/usb/host/ohci-nxp.c | |||
@@ -181,8 +181,9 @@ static int ohci_hcd_nxp_probe(struct platform_device *pdev) | |||
181 | return -EPROBE_DEFER; | 181 | return -EPROBE_DEFER; |
182 | } | 182 | } |
183 | 183 | ||
184 | pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); | 184 | ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); |
185 | pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; | 185 | if (ret) |
186 | goto fail_disable; | ||
186 | 187 | ||
187 | dev_dbg(&pdev->dev, "%s: " DRIVER_DESC " (nxp)\n", hcd_name); | 188 | dev_dbg(&pdev->dev, "%s: " DRIVER_DESC " (nxp)\n", hcd_name); |
188 | if (usb_disabled()) { | 189 | if (usb_disabled()) { |
diff --git a/drivers/usb/host/ohci-octeon.c b/drivers/usb/host/ohci-octeon.c index 342dc7e543b8..6c16dcef15c6 100644 --- a/drivers/usb/host/ohci-octeon.c +++ b/drivers/usb/host/ohci-octeon.c | |||
@@ -127,8 +127,9 @@ static int ohci_octeon_drv_probe(struct platform_device *pdev) | |||
127 | } | 127 | } |
128 | 128 | ||
129 | /* Ohci is a 32-bit device. */ | 129 | /* Ohci is a 32-bit device. */ |
130 | pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); | 130 | ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); |
131 | pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; | 131 | if (ret) |
132 | return ret; | ||
132 | 133 | ||
133 | hcd = usb_create_hcd(&ohci_octeon_hc_driver, &pdev->dev, "octeon"); | 134 | hcd = usb_create_hcd(&ohci_octeon_hc_driver, &pdev->dev, "octeon"); |
134 | if (!hcd) | 135 | if (!hcd) |
diff --git a/drivers/usb/host/ohci-omap3.c b/drivers/usb/host/ohci-omap3.c index 408d06a68571..21457417a856 100644 --- a/drivers/usb/host/ohci-omap3.c +++ b/drivers/usb/host/ohci-omap3.c | |||
@@ -65,7 +65,7 @@ static int ohci_hcd_omap3_probe(struct platform_device *pdev) | |||
65 | struct usb_hcd *hcd = NULL; | 65 | struct usb_hcd *hcd = NULL; |
66 | void __iomem *regs = NULL; | 66 | void __iomem *regs = NULL; |
67 | struct resource *res; | 67 | struct resource *res; |
68 | int ret = -ENODEV; | 68 | int ret; |
69 | int irq; | 69 | int irq; |
70 | 70 | ||
71 | if (usb_disabled()) | 71 | if (usb_disabled()) |
@@ -99,11 +99,11 @@ static int ohci_hcd_omap3_probe(struct platform_device *pdev) | |||
99 | * Since shared usb code relies on it, set it here for now. | 99 | * Since shared usb code relies on it, set it here for now. |
100 | * Once we have dma capability bindings this can go away. | 100 | * Once we have dma capability bindings this can go away. |
101 | */ | 101 | */ |
102 | if (!dev->dma_mask) | 102 | ret = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(32)); |
103 | dev->dma_mask = &dev->coherent_dma_mask; | 103 | if (ret) |
104 | if (!dev->coherent_dma_mask) | 104 | goto err_io; |
105 | dev->coherent_dma_mask = DMA_BIT_MASK(32); | ||
106 | 105 | ||
106 | ret = -ENODEV; | ||
107 | hcd = usb_create_hcd(&ohci_omap3_hc_driver, dev, | 107 | hcd = usb_create_hcd(&ohci_omap3_hc_driver, dev, |
108 | dev_name(dev)); | 108 | dev_name(dev)); |
109 | if (!hcd) { | 109 | if (!hcd) { |
diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c index deea5d1d6394..e89ac4d4b87e 100644 --- a/drivers/usb/host/ohci-pxa27x.c +++ b/drivers/usb/host/ohci-pxa27x.c | |||
@@ -298,6 +298,7 @@ static int ohci_pxa_of_init(struct platform_device *pdev) | |||
298 | struct device_node *np = pdev->dev.of_node; | 298 | struct device_node *np = pdev->dev.of_node; |
299 | struct pxaohci_platform_data *pdata; | 299 | struct pxaohci_platform_data *pdata; |
300 | u32 tmp; | 300 | u32 tmp; |
301 | int ret; | ||
301 | 302 | ||
302 | if (!np) | 303 | if (!np) |
303 | return 0; | 304 | return 0; |
@@ -306,10 +307,9 @@ static int ohci_pxa_of_init(struct platform_device *pdev) | |||
306 | * Since shared usb code relies on it, set it here for now. | 307 | * Since shared usb code relies on it, set it here for now. |
307 | * Once we have dma capability bindings this can go away. | 308 | * Once we have dma capability bindings this can go away. |
308 | */ | 309 | */ |
309 | if (!pdev->dev.dma_mask) | 310 | ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); |
310 | pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; | 311 | if (ret) |
311 | if (!pdev->dev.coherent_dma_mask) | 312 | return ret; |
312 | pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); | ||
313 | 313 | ||
314 | pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); | 314 | pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); |
315 | if (!pdata) | 315 | if (!pdata) |
diff --git a/drivers/usb/host/ohci-sa1111.c b/drivers/usb/host/ohci-sa1111.c index 17b2a7dad77b..aa9e127bbe71 100644 --- a/drivers/usb/host/ohci-sa1111.c +++ b/drivers/usb/host/ohci-sa1111.c | |||
@@ -185,6 +185,12 @@ static int ohci_hcd_sa1111_probe(struct sa1111_dev *dev) | |||
185 | if (usb_disabled()) | 185 | if (usb_disabled()) |
186 | return -ENODEV; | 186 | return -ENODEV; |
187 | 187 | ||
188 | /* | ||
189 | * We don't call dma_set_mask_and_coherent() here because the | ||
190 | * DMA mask has already been appropraitely setup by the core | ||
191 | * SA-1111 bus code (which includes bug workarounds.) | ||
192 | */ | ||
193 | |||
188 | hcd = usb_create_hcd(&ohci_sa1111_hc_driver, &dev->dev, "sa1111"); | 194 | hcd = usb_create_hcd(&ohci_sa1111_hc_driver, &dev->dev, "sa1111"); |
189 | if (!hcd) | 195 | if (!hcd) |
190 | return -ENOMEM; | 196 | return -ENOMEM; |
diff --git a/drivers/usb/host/ohci-spear.c b/drivers/usb/host/ohci-spear.c index 31ff3fc4e26f..6b02107d281d 100644 --- a/drivers/usb/host/ohci-spear.c +++ b/drivers/usb/host/ohci-spear.c | |||
@@ -56,10 +56,9 @@ static int spear_ohci_hcd_drv_probe(struct platform_device *pdev) | |||
56 | * Since shared usb code relies on it, set it here for now. | 56 | * Since shared usb code relies on it, set it here for now. |
57 | * Once we have dma capability bindings this can go away. | 57 | * Once we have dma capability bindings this can go away. |
58 | */ | 58 | */ |
59 | if (!pdev->dev.dma_mask) | 59 | retval = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); |
60 | pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; | 60 | if (retval) |
61 | if (!pdev->dev.coherent_dma_mask) | 61 | goto fail; |
62 | pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); | ||
63 | 62 | ||
64 | usbh_clk = devm_clk_get(&pdev->dev, NULL); | 63 | usbh_clk = devm_clk_get(&pdev->dev, NULL); |
65 | if (IS_ERR(usbh_clk)) { | 64 | if (IS_ERR(usbh_clk)) { |
diff --git a/drivers/usb/host/ssb-hcd.c b/drivers/usb/host/ssb-hcd.c index 74af2c6287d2..0196f766df73 100644 --- a/drivers/usb/host/ssb-hcd.c +++ b/drivers/usb/host/ssb-hcd.c | |||
@@ -163,8 +163,7 @@ static int ssb_hcd_probe(struct ssb_device *dev, | |||
163 | 163 | ||
164 | /* TODO: Probably need checks here; is the core connected? */ | 164 | /* TODO: Probably need checks here; is the core connected? */ |
165 | 165 | ||
166 | if (dma_set_mask(dev->dma_dev, DMA_BIT_MASK(32)) || | 166 | if (dma_set_mask_and_coherent(dev->dma_dev, DMA_BIT_MASK(32))) |
167 | dma_set_coherent_mask(dev->dma_dev, DMA_BIT_MASK(32))) | ||
168 | return -EOPNOTSUPP; | 167 | return -EOPNOTSUPP; |
169 | 168 | ||
170 | usb_dev = kzalloc(sizeof(struct ssb_hcd_device), GFP_KERNEL); | 169 | usb_dev = kzalloc(sizeof(struct ssb_hcd_device), GFP_KERNEL); |
diff --git a/drivers/usb/host/uhci-platform.c b/drivers/usb/host/uhci-platform.c index ded842bc6578..3003fefaa964 100644 --- a/drivers/usb/host/uhci-platform.c +++ b/drivers/usb/host/uhci-platform.c | |||
@@ -75,10 +75,9 @@ static int uhci_hcd_platform_probe(struct platform_device *pdev) | |||
75 | * Since shared usb code relies on it, set it here for now. | 75 | * Since shared usb code relies on it, set it here for now. |
76 | * Once we have dma capability bindings this can go away. | 76 | * Once we have dma capability bindings this can go away. |
77 | */ | 77 | */ |
78 | if (!pdev->dev.dma_mask) | 78 | ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); |
79 | pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; | 79 | if (ret) |
80 | if (!pdev->dev.coherent_dma_mask) | 80 | return ret; |
81 | pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); | ||
82 | 81 | ||
83 | hcd = usb_create_hcd(&uhci_platform_hc_driver, &pdev->dev, | 82 | hcd = usb_create_hcd(&uhci_platform_hc_driver, &pdev->dev, |
84 | pdev->name); | 83 | pdev->name); |
diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c index 84657e07dc5d..439c951f261b 100644 --- a/drivers/usb/serial/mos7720.c +++ b/drivers/usb/serial/mos7720.c | |||
@@ -455,7 +455,7 @@ static int parport_prologue(struct parport *pp) | |||
455 | return -1; | 455 | return -1; |
456 | } | 456 | } |
457 | mos_parport->msg_pending = true; /* synch usb call pending */ | 457 | mos_parport->msg_pending = true; /* synch usb call pending */ |
458 | INIT_COMPLETION(mos_parport->syncmsg_compl); | 458 | reinit_completion(&mos_parport->syncmsg_compl); |
459 | spin_unlock(&release_lock); | 459 | spin_unlock(&release_lock); |
460 | 460 | ||
461 | mutex_lock(&mos_parport->serial->disc_mutex); | 461 | mutex_lock(&mos_parport->serial->disc_mutex); |