diff options
Diffstat (limited to 'drivers/usb/host')
-rw-r--r-- | drivers/usb/host/ehci-atmel.c | 7 | ||||
-rw-r--r-- | drivers/usb/host/ehci-grlib.c | 9 | ||||
-rw-r--r-- | drivers/usb/host/ehci-mxc.c | 7 | ||||
-rw-r--r-- | drivers/usb/host/ehci-platform.c | 7 | ||||
-rw-r--r-- | drivers/usb/host/ehci-ppc-of.c | 8 | ||||
-rw-r--r-- | drivers/usb/host/ehci-sead3.c | 8 | ||||
-rw-r--r-- | drivers/usb/host/ehci-sh.c | 7 | ||||
-rw-r--r-- | drivers/usb/host/ehci-vt8500.c | 8 | ||||
-rw-r--r-- | drivers/usb/host/ehci-xilinx-of.c | 8 | ||||
-rw-r--r-- | drivers/usb/host/ohci-nxp.c | 7 | ||||
-rw-r--r-- | drivers/usb/host/ohci-platform.c | 7 | ||||
-rw-r--r-- | drivers/usb/host/ohci-s3c2410.c | 7 |
12 files changed, 43 insertions, 47 deletions
diff --git a/drivers/usb/host/ehci-atmel.c b/drivers/usb/host/ehci-atmel.c index 27639487f7ac..f3beac4d06b8 100644 --- a/drivers/usb/host/ehci-atmel.c +++ b/drivers/usb/host/ehci-atmel.c | |||
@@ -143,10 +143,9 @@ static int ehci_atmel_drv_probe(struct platform_device *pdev) | |||
143 | hcd->rsrc_start = res->start; | 143 | hcd->rsrc_start = res->start; |
144 | hcd->rsrc_len = resource_size(res); | 144 | hcd->rsrc_len = resource_size(res); |
145 | 145 | ||
146 | hcd->regs = devm_request_and_ioremap(&pdev->dev, res); | 146 | hcd->regs = devm_ioremap_resource(&pdev->dev, res); |
147 | if (hcd->regs == NULL) { | 147 | if (IS_ERR(hcd->regs)) { |
148 | dev_dbg(&pdev->dev, "error mapping memory\n"); | 148 | retval = PTR_ERR(hcd->regs); |
149 | retval = -EFAULT; | ||
150 | goto fail_request_resource; | 149 | goto fail_request_resource; |
151 | } | 150 | } |
152 | 151 | ||
diff --git a/drivers/usb/host/ehci-grlib.c b/drivers/usb/host/ehci-grlib.c index 1fc89292f5d6..5d75de9729b6 100644 --- a/drivers/usb/host/ehci-grlib.c +++ b/drivers/usb/host/ehci-grlib.c | |||
@@ -25,7 +25,7 @@ | |||
25 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 25 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | 28 | #include <linux/err.h> | |
29 | #include <linux/signal.h> | 29 | #include <linux/signal.h> |
30 | 30 | ||
31 | #include <linux/of_irq.h> | 31 | #include <linux/of_irq.h> |
@@ -118,10 +118,9 @@ static int ehci_hcd_grlib_probe(struct platform_device *op) | |||
118 | goto err_irq; | 118 | goto err_irq; |
119 | } | 119 | } |
120 | 120 | ||
121 | hcd->regs = devm_request_and_ioremap(&op->dev, &res); | 121 | hcd->regs = devm_ioremap_resource(&op->dev, &res); |
122 | if (!hcd->regs) { | 122 | if (IS_ERR(hcd->regs)) { |
123 | pr_err("%s: devm_request_and_ioremap failed\n", __FILE__); | 123 | rv = PTR_ERR(hcd->regs); |
124 | rv = -ENOMEM; | ||
125 | goto err_ioremap; | 124 | goto err_ioremap; |
126 | } | 125 | } |
127 | 126 | ||
diff --git a/drivers/usb/host/ehci-mxc.c b/drivers/usb/host/ehci-mxc.c index dedb80bb8d40..e2004de6ad3d 100644 --- a/drivers/usb/host/ehci-mxc.c +++ b/drivers/usb/host/ehci-mxc.c | |||
@@ -85,10 +85,9 @@ static int ehci_mxc_drv_probe(struct platform_device *pdev) | |||
85 | hcd->rsrc_start = res->start; | 85 | hcd->rsrc_start = res->start; |
86 | hcd->rsrc_len = resource_size(res); | 86 | hcd->rsrc_len = resource_size(res); |
87 | 87 | ||
88 | hcd->regs = devm_request_and_ioremap(&pdev->dev, res); | 88 | hcd->regs = devm_ioremap_resource(&pdev->dev, res); |
89 | if (!hcd->regs) { | 89 | if (IS_ERR(hcd->regs)) { |
90 | dev_err(dev, "error mapping memory\n"); | 90 | ret = PTR_ERR(hcd->regs); |
91 | ret = -EFAULT; | ||
92 | goto err_alloc; | 91 | goto err_alloc; |
93 | } | 92 | } |
94 | 93 | ||
diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c index 58fa0c90c7c7..ca7506390542 100644 --- a/drivers/usb/host/ehci-platform.c +++ b/drivers/usb/host/ehci-platform.c | |||
@@ -18,6 +18,7 @@ | |||
18 | * | 18 | * |
19 | * Licensed under the GNU/GPL. See COPYING for details. | 19 | * Licensed under the GNU/GPL. See COPYING for details. |
20 | */ | 20 | */ |
21 | #include <linux/err.h> | ||
21 | #include <linux/kernel.h> | 22 | #include <linux/kernel.h> |
22 | #include <linux/hrtimer.h> | 23 | #include <linux/hrtimer.h> |
23 | #include <linux/io.h> | 24 | #include <linux/io.h> |
@@ -104,9 +105,9 @@ static int ehci_platform_probe(struct platform_device *dev) | |||
104 | hcd->rsrc_start = res_mem->start; | 105 | hcd->rsrc_start = res_mem->start; |
105 | hcd->rsrc_len = resource_size(res_mem); | 106 | hcd->rsrc_len = resource_size(res_mem); |
106 | 107 | ||
107 | hcd->regs = devm_request_and_ioremap(&dev->dev, res_mem); | 108 | hcd->regs = devm_ioremap_resource(&dev->dev, res_mem); |
108 | if (!hcd->regs) { | 109 | if (IS_ERR(hcd->regs)) { |
109 | err = -ENOMEM; | 110 | err = PTR_ERR(hcd->regs); |
110 | goto err_put_hcd; | 111 | goto err_put_hcd; |
111 | } | 112 | } |
112 | err = usb_add_hcd(hcd, irq, IRQF_SHARED); | 113 | err = usb_add_hcd(hcd, irq, IRQF_SHARED); |
diff --git a/drivers/usb/host/ehci-ppc-of.c b/drivers/usb/host/ehci-ppc-of.c index 45aceefd0c2b..56dc732bf451 100644 --- a/drivers/usb/host/ehci-ppc-of.c +++ b/drivers/usb/host/ehci-ppc-of.c | |||
@@ -12,6 +12,7 @@ | |||
12 | * This file is licenced under the GPL. | 12 | * This file is licenced under the GPL. |
13 | */ | 13 | */ |
14 | 14 | ||
15 | #include <linux/err.h> | ||
15 | #include <linux/signal.h> | 16 | #include <linux/signal.h> |
16 | 17 | ||
17 | #include <linux/of.h> | 18 | #include <linux/of.h> |
@@ -121,10 +122,9 @@ static int ehci_hcd_ppc_of_probe(struct platform_device *op) | |||
121 | goto err_irq; | 122 | goto err_irq; |
122 | } | 123 | } |
123 | 124 | ||
124 | hcd->regs = devm_request_and_ioremap(&op->dev, &res); | 125 | hcd->regs = devm_ioremap_resource(&op->dev, &res); |
125 | if (!hcd->regs) { | 126 | if (IS_ERR(hcd->regs)) { |
126 | pr_err("%s: devm_request_and_ioremap failed\n", __FILE__); | 127 | rv = PTR_ERR(hcd->regs); |
127 | rv = -ENOMEM; | ||
128 | goto err_ioremap; | 128 | goto err_ioremap; |
129 | } | 129 | } |
130 | 130 | ||
diff --git a/drivers/usb/host/ehci-sead3.c b/drivers/usb/host/ehci-sead3.c index efad02d947f2..f55477c5a1be 100644 --- a/drivers/usb/host/ehci-sead3.c +++ b/drivers/usb/host/ehci-sead3.c | |||
@@ -19,6 +19,7 @@ | |||
19 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 19 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #include <linux/err.h> | ||
22 | #include <linux/platform_device.h> | 23 | #include <linux/platform_device.h> |
23 | 24 | ||
24 | static int ehci_sead3_setup(struct usb_hcd *hcd) | 25 | static int ehci_sead3_setup(struct usb_hcd *hcd) |
@@ -112,10 +113,9 @@ static int ehci_hcd_sead3_drv_probe(struct platform_device *pdev) | |||
112 | hcd->rsrc_start = res->start; | 113 | hcd->rsrc_start = res->start; |
113 | hcd->rsrc_len = resource_size(res); | 114 | hcd->rsrc_len = resource_size(res); |
114 | 115 | ||
115 | hcd->regs = devm_request_and_ioremap(&pdev->dev, res); | 116 | hcd->regs = devm_ioremap_resource(&pdev->dev, res); |
116 | if (!hcd->regs) { | 117 | if (IS_ERR(hcd->regs)) { |
117 | pr_debug("ioremap failed"); | 118 | ret = PTR_ERR(hcd->regs); |
118 | ret = -ENOMEM; | ||
119 | goto err1; | 119 | goto err1; |
120 | } | 120 | } |
121 | 121 | ||
diff --git a/drivers/usb/host/ehci-sh.c b/drivers/usb/host/ehci-sh.c index 0c90a24fa989..3565a300f401 100644 --- a/drivers/usb/host/ehci-sh.c +++ b/drivers/usb/host/ehci-sh.c | |||
@@ -118,10 +118,9 @@ static int ehci_hcd_sh_probe(struct platform_device *pdev) | |||
118 | hcd->rsrc_start = res->start; | 118 | hcd->rsrc_start = res->start; |
119 | hcd->rsrc_len = resource_size(res); | 119 | hcd->rsrc_len = resource_size(res); |
120 | 120 | ||
121 | hcd->regs = devm_request_and_ioremap(&pdev->dev, res); | 121 | hcd->regs = devm_ioremap_resource(&pdev->dev, res); |
122 | if (hcd->regs == NULL) { | 122 | if (IS_ERR(hcd->regs)) { |
123 | dev_dbg(&pdev->dev, "error mapping memory\n"); | 123 | ret = PTR_ERR(hcd->regs); |
124 | ret = -ENXIO; | ||
125 | goto fail_request_resource; | 124 | goto fail_request_resource; |
126 | } | 125 | } |
127 | 126 | ||
diff --git a/drivers/usb/host/ehci-vt8500.c b/drivers/usb/host/ehci-vt8500.c index 11695d5b9d86..7ecf709610ba 100644 --- a/drivers/usb/host/ehci-vt8500.c +++ b/drivers/usb/host/ehci-vt8500.c | |||
@@ -16,6 +16,7 @@ | |||
16 | * | 16 | * |
17 | */ | 17 | */ |
18 | 18 | ||
19 | #include <linux/err.h> | ||
19 | #include <linux/of.h> | 20 | #include <linux/of.h> |
20 | #include <linux/platform_device.h> | 21 | #include <linux/platform_device.h> |
21 | 22 | ||
@@ -96,10 +97,9 @@ static int vt8500_ehci_drv_probe(struct platform_device *pdev) | |||
96 | hcd->rsrc_start = res->start; | 97 | hcd->rsrc_start = res->start; |
97 | hcd->rsrc_len = resource_size(res); | 98 | hcd->rsrc_len = resource_size(res); |
98 | 99 | ||
99 | hcd->regs = devm_request_and_ioremap(&pdev->dev, res); | 100 | hcd->regs = devm_ioremap_resource(&pdev->dev, res); |
100 | if (!hcd->regs) { | 101 | if (IS_ERR(hcd->regs)) { |
101 | pr_debug("ioremap failed"); | 102 | ret = PTR_ERR(hcd->regs); |
102 | ret = -ENOMEM; | ||
103 | goto err1; | 103 | goto err1; |
104 | } | 104 | } |
105 | 105 | ||
diff --git a/drivers/usb/host/ehci-xilinx-of.c b/drivers/usb/host/ehci-xilinx-of.c index 4f285e8e404a..d845e3bcfaff 100644 --- a/drivers/usb/host/ehci-xilinx-of.c +++ b/drivers/usb/host/ehci-xilinx-of.c | |||
@@ -25,6 +25,7 @@ | |||
25 | * | 25 | * |
26 | */ | 26 | */ |
27 | 27 | ||
28 | #include <linux/err.h> | ||
28 | #include <linux/signal.h> | 29 | #include <linux/signal.h> |
29 | 30 | ||
30 | #include <linux/of.h> | 31 | #include <linux/of.h> |
@@ -159,10 +160,9 @@ static int ehci_hcd_xilinx_of_probe(struct platform_device *op) | |||
159 | goto err_irq; | 160 | goto err_irq; |
160 | } | 161 | } |
161 | 162 | ||
162 | hcd->regs = devm_request_and_ioremap(&op->dev, &res); | 163 | hcd->regs = devm_ioremap_resource(&op->dev, &res); |
163 | if (!hcd->regs) { | 164 | if (IS_ERR(hcd->regs)) { |
164 | pr_err("%s: devm_request_and_ioremap failed\n", __FILE__); | 165 | rv = PTR_ERR(hcd->regs); |
165 | rv = -ENOMEM; | ||
166 | goto err_irq; | 166 | goto err_irq; |
167 | } | 167 | } |
168 | 168 | ||
diff --git a/drivers/usb/host/ohci-nxp.c b/drivers/usb/host/ohci-nxp.c index 2344040c16d2..f4988fbe78e7 100644 --- a/drivers/usb/host/ohci-nxp.c +++ b/drivers/usb/host/ohci-nxp.c | |||
@@ -306,10 +306,9 @@ static int usb_hcd_nxp_probe(struct platform_device *pdev) | |||
306 | goto out8; | 306 | goto out8; |
307 | } | 307 | } |
308 | 308 | ||
309 | hcd->regs = devm_request_and_ioremap(&pdev->dev, res); | 309 | hcd->regs = devm_ioremap_resource(&pdev->dev, res); |
310 | if (!hcd->regs) { | 310 | if (IS_ERR(hcd->regs)) { |
311 | dev_err(&pdev->dev, "Failed to devm_request_and_ioremap\n"); | 311 | ret = PTR_ERR(hcd->regs); |
312 | ret = -ENOMEM; | ||
313 | goto out8; | 312 | goto out8; |
314 | } | 313 | } |
315 | hcd->rsrc_start = res->start; | 314 | hcd->rsrc_start = res->start; |
diff --git a/drivers/usb/host/ohci-platform.c b/drivers/usb/host/ohci-platform.c index 084503b03fcf..c3e7287f7921 100644 --- a/drivers/usb/host/ohci-platform.c +++ b/drivers/usb/host/ohci-platform.c | |||
@@ -13,6 +13,7 @@ | |||
13 | * | 13 | * |
14 | * Licensed under the GNU/GPL. See COPYING for details. | 14 | * Licensed under the GNU/GPL. See COPYING for details. |
15 | */ | 15 | */ |
16 | #include <linux/err.h> | ||
16 | #include <linux/platform_device.h> | 17 | #include <linux/platform_device.h> |
17 | #include <linux/usb/ohci_pdriver.h> | 18 | #include <linux/usb/ohci_pdriver.h> |
18 | 19 | ||
@@ -127,9 +128,9 @@ static int ohci_platform_probe(struct platform_device *dev) | |||
127 | hcd->rsrc_start = res_mem->start; | 128 | hcd->rsrc_start = res_mem->start; |
128 | hcd->rsrc_len = resource_size(res_mem); | 129 | hcd->rsrc_len = resource_size(res_mem); |
129 | 130 | ||
130 | hcd->regs = devm_request_and_ioremap(&dev->dev, res_mem); | 131 | hcd->regs = devm_ioremap_resource(&dev->dev, res_mem); |
131 | if (!hcd->regs) { | 132 | if (IS_ERR(hcd->regs)) { |
132 | err = -ENOMEM; | 133 | err = PTR_ERR(hcd->regs); |
133 | goto err_put_hcd; | 134 | goto err_put_hcd; |
134 | } | 135 | } |
135 | err = usb_add_hcd(hcd, irq, IRQF_SHARED); | 136 | err = usb_add_hcd(hcd, irq, IRQF_SHARED); |
diff --git a/drivers/usb/host/ohci-s3c2410.c b/drivers/usb/host/ohci-s3c2410.c index ad0f55269603..e125770b893c 100644 --- a/drivers/usb/host/ohci-s3c2410.c +++ b/drivers/usb/host/ohci-s3c2410.c | |||
@@ -351,10 +351,9 @@ static int usb_hcd_s3c2410_probe(const struct hc_driver *driver, | |||
351 | hcd->rsrc_start = dev->resource[0].start; | 351 | hcd->rsrc_start = dev->resource[0].start; |
352 | hcd->rsrc_len = resource_size(&dev->resource[0]); | 352 | hcd->rsrc_len = resource_size(&dev->resource[0]); |
353 | 353 | ||
354 | hcd->regs = devm_request_and_ioremap(&dev->dev, &dev->resource[0]); | 354 | hcd->regs = devm_ioremap_resource(&dev->dev, &dev->resource[0]); |
355 | if (!hcd->regs) { | 355 | if (IS_ERR(hcd->regs)) { |
356 | dev_err(&dev->dev, "devm_request_and_ioremap failed\n"); | 356 | retval = PTR_ERR(hcd->regs); |
357 | retval = -ENOMEM; | ||
358 | goto err_put; | 357 | goto err_put; |
359 | } | 358 | } |
360 | 359 | ||