diff options
author | Thierry Reding <thierry.reding@avionic-design.de> | 2013-01-21 05:09:22 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-22 14:41:58 -0500 |
commit | 148e11349b0c9c7199fd3096254bd3ea16d59a05 (patch) | |
tree | 48fa3e59a152ad95b4e545e1e623c3e442653d53 | |
parent | eb612fa013ca07b954300fa46b1499248cedf926 (diff) |
usb: Convert to devm_ioremap_resource()
Convert all uses of devm_request_and_ioremap() to the newly introduced
devm_ioremap_resource() which provides more consistent error handling.
devm_ioremap_resource() provides its own error messages so all explicit
error messages can be removed from the failure code paths.
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/usb/chipidea/usbmisc_imx6q.c | 6 | ||||
-rw-r--r-- | drivers/usb/gadget/bcm63xx_udc.c | 13 | ||||
-rw-r--r-- | drivers/usb/gadget/s3c-hsotg.c | 7 | ||||
-rw-r--r-- | drivers/usb/gadget/s3c-hsudc.c | 7 | ||||
-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 | ||||
-rw-r--r-- | drivers/usb/musb/musb_dsps.c | 7 | ||||
-rw-r--r-- | drivers/usb/musb/omap2430.c | 4 | ||||
-rw-r--r-- | drivers/usb/otg/mxs-phy.c | 6 | ||||
-rw-r--r-- | drivers/usb/phy/mv_u3d_phy.c | 8 | ||||
-rw-r--r-- | drivers/usb/phy/omap-usb2.c | 8 | ||||
-rw-r--r-- | drivers/usb/renesas_usbhs/common.c | 9 |
22 files changed, 76 insertions, 89 deletions
diff --git a/drivers/usb/chipidea/usbmisc_imx6q.c b/drivers/usb/chipidea/usbmisc_imx6q.c index 845efe29e6b9..a1bce391e825 100644 --- a/drivers/usb/chipidea/usbmisc_imx6q.c +++ b/drivers/usb/chipidea/usbmisc_imx6q.c | |||
@@ -98,9 +98,9 @@ static int usbmisc_imx6q_probe(struct platform_device *pdev) | |||
98 | spin_lock_init(&data->lock); | 98 | spin_lock_init(&data->lock); |
99 | 99 | ||
100 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 100 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
101 | data->base = devm_request_and_ioremap(&pdev->dev, res); | 101 | data->base = devm_ioremap_resource(&pdev->dev, res); |
102 | if (!data->base) | 102 | if (IS_ERR(data->base)) |
103 | return -EADDRNOTAVAIL; | 103 | return PTR_ERR(data->base); |
104 | 104 | ||
105 | data->clk = devm_clk_get(&pdev->dev, NULL); | 105 | data->clk = devm_clk_get(&pdev->dev, NULL); |
106 | if (IS_ERR(data->clk)) { | 106 | if (IS_ERR(data->clk)) { |
diff --git a/drivers/usb/gadget/bcm63xx_udc.c b/drivers/usb/gadget/bcm63xx_udc.c index 47a49931361e..8cc8253f1100 100644 --- a/drivers/usb/gadget/bcm63xx_udc.c +++ b/drivers/usb/gadget/bcm63xx_udc.c | |||
@@ -2351,19 +2351,20 @@ static int bcm63xx_udc_probe(struct platform_device *pdev) | |||
2351 | dev_err(dev, "error finding USBD resource\n"); | 2351 | dev_err(dev, "error finding USBD resource\n"); |
2352 | return -ENXIO; | 2352 | return -ENXIO; |
2353 | } | 2353 | } |
2354 | udc->usbd_regs = devm_request_and_ioremap(dev, res); | 2354 | |
2355 | udc->usbd_regs = devm_ioremap_resource(dev, res); | ||
2356 | if (IS_ERR(udc->usbd_regs)) | ||
2357 | return PTR_ERR(udc->usbd_regs); | ||
2355 | 2358 | ||
2356 | res = platform_get_resource(pdev, IORESOURCE_MEM, 1); | 2359 | res = platform_get_resource(pdev, IORESOURCE_MEM, 1); |
2357 | if (!res) { | 2360 | if (!res) { |
2358 | dev_err(dev, "error finding IUDMA resource\n"); | 2361 | dev_err(dev, "error finding IUDMA resource\n"); |
2359 | return -ENXIO; | 2362 | return -ENXIO; |
2360 | } | 2363 | } |
2361 | udc->iudma_regs = devm_request_and_ioremap(dev, res); | ||
2362 | 2364 | ||
2363 | if (!udc->usbd_regs || !udc->iudma_regs) { | 2365 | udc->iudma_regs = devm_ioremap_resource(dev, res); |
2364 | dev_err(dev, "error requesting resources\n"); | 2366 | if (IS_ERR(udc->iudma_regs)) |
2365 | return -ENXIO; | 2367 | return PTR_ERR(udc->iudma_regs); |
2366 | } | ||
2367 | 2368 | ||
2368 | spin_lock_init(&udc->lock); | 2369 | spin_lock_init(&udc->lock); |
2369 | INIT_WORK(&udc->ep0_wq, bcm63xx_ep0_process); | 2370 | INIT_WORK(&udc->ep0_wq, bcm63xx_ep0_process); |
diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c index 439c3f972f8c..de80fa644b5a 100644 --- a/drivers/usb/gadget/s3c-hsotg.c +++ b/drivers/usb/gadget/s3c-hsotg.c | |||
@@ -3525,10 +3525,9 @@ static int s3c_hsotg_probe(struct platform_device *pdev) | |||
3525 | 3525 | ||
3526 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 3526 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
3527 | 3527 | ||
3528 | hsotg->regs = devm_request_and_ioremap(&pdev->dev, res); | 3528 | hsotg->regs = devm_ioremap_resource(&pdev->dev, res); |
3529 | if (!hsotg->regs) { | 3529 | if (IS_ERR(hsotg->regs)) { |
3530 | dev_err(dev, "cannot map registers\n"); | 3530 | ret = PTR_ERR(hsotg->regs); |
3531 | ret = -ENXIO; | ||
3532 | goto err_clk; | 3531 | goto err_clk; |
3533 | } | 3532 | } |
3534 | 3533 | ||
diff --git a/drivers/usb/gadget/s3c-hsudc.c b/drivers/usb/gadget/s3c-hsudc.c index 52379b11f080..94ca33bb990b 100644 --- a/drivers/usb/gadget/s3c-hsudc.c +++ b/drivers/usb/gadget/s3c-hsudc.c | |||
@@ -1295,10 +1295,9 @@ static int s3c_hsudc_probe(struct platform_device *pdev) | |||
1295 | 1295 | ||
1296 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 1296 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
1297 | 1297 | ||
1298 | hsudc->regs = devm_request_and_ioremap(&pdev->dev, res); | 1298 | hsudc->regs = devm_ioremap_resource(&pdev->dev, res); |
1299 | if (!hsudc->regs) { | 1299 | if (IS_ERR(hsudc->regs)) { |
1300 | dev_err(dev, "error mapping device register area\n"); | 1300 | ret = PTR_ERR(hsudc->regs); |
1301 | ret = -EBUSY; | ||
1302 | goto err_res; | 1301 | goto err_res; |
1303 | } | 1302 | } |
1304 | 1303 | ||
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 ec7f5d2c90de..4f506af4c303 100644 --- a/drivers/usb/host/ehci-mxc.c +++ b/drivers/usb/host/ehci-mxc.c | |||
@@ -128,10 +128,9 @@ static int ehci_mxc_drv_probe(struct platform_device *pdev) | |||
128 | hcd->rsrc_start = res->start; | 128 | hcd->rsrc_start = res->start; |
129 | hcd->rsrc_len = resource_size(res); | 129 | hcd->rsrc_len = resource_size(res); |
130 | 130 | ||
131 | hcd->regs = devm_request_and_ioremap(&pdev->dev, res); | 131 | hcd->regs = devm_ioremap_resource(&pdev->dev, res); |
132 | if (!hcd->regs) { | 132 | if (IS_ERR(hcd->regs)) { |
133 | dev_err(dev, "error mapping memory\n"); | 133 | ret = PTR_ERR(hcd->regs); |
134 | ret = -EFAULT; | ||
135 | goto err_alloc; | 134 | goto err_alloc; |
136 | } | 135 | } |
137 | 136 | ||
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 | ||
diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c index f7d764de6fda..99f470d26a38 100644 --- a/drivers/usb/musb/musb_dsps.c +++ b/drivers/usb/musb/musb_dsps.c | |||
@@ -500,10 +500,9 @@ static int dsps_create_musb_pdev(struct dsps_glue *glue, u8 id) | |||
500 | resources[0].end = resources[0].start + SZ_4 - 1; | 500 | resources[0].end = resources[0].start + SZ_4 - 1; |
501 | resources[0].flags = IORESOURCE_MEM; | 501 | resources[0].flags = IORESOURCE_MEM; |
502 | 502 | ||
503 | glue->usb_ctrl[id] = devm_request_and_ioremap(&pdev->dev, resources); | 503 | glue->usb_ctrl[id] = devm_ioremap_resource(&pdev->dev, resources); |
504 | if (glue->usb_ctrl[id] == NULL) { | 504 | if (IS_ERR(glue->usb_ctrl[id])) { |
505 | dev_err(dev, "Failed to obtain usb_ctrl%d memory\n", id); | 505 | ret = PTR_ERR(glue->usb_ctrl[id]); |
506 | ret = -ENODEV; | ||
507 | goto err0; | 506 | goto err0; |
508 | } | 507 | } |
509 | 508 | ||
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index da00af460794..acd5f9d71d03 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c | |||
@@ -523,9 +523,7 @@ static int omap2430_probe(struct platform_device *pdev) | |||
523 | 523 | ||
524 | res = platform_get_resource(pdev, IORESOURCE_MEM, 1); | 524 | res = platform_get_resource(pdev, IORESOURCE_MEM, 1); |
525 | 525 | ||
526 | glue->control_otghs = devm_request_and_ioremap(&pdev->dev, res); | 526 | glue->control_otghs = devm_ioremap_resource(&pdev->dev, res); |
527 | if (glue->control_otghs == NULL) | ||
528 | dev_dbg(&pdev->dev, "Failed to obtain control memory\n"); | ||
529 | 527 | ||
530 | if (np) { | 528 | if (np) { |
531 | pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); | 529 | pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); |
diff --git a/drivers/usb/otg/mxs-phy.c b/drivers/usb/otg/mxs-phy.c index 76302720055a..60df28a294b7 100644 --- a/drivers/usb/otg/mxs-phy.c +++ b/drivers/usb/otg/mxs-phy.c | |||
@@ -115,9 +115,9 @@ static int mxs_phy_probe(struct platform_device *pdev) | |||
115 | return -ENOENT; | 115 | return -ENOENT; |
116 | } | 116 | } |
117 | 117 | ||
118 | base = devm_request_and_ioremap(&pdev->dev, res); | 118 | base = devm_ioremap_resource(&pdev->dev, res); |
119 | if (!base) | 119 | if (IS_ERR(base)) |
120 | return -EBUSY; | 120 | return PTR_ERR(base); |
121 | 121 | ||
122 | clk = devm_clk_get(&pdev->dev, NULL); | 122 | clk = devm_clk_get(&pdev->dev, NULL); |
123 | if (IS_ERR(clk)) { | 123 | if (IS_ERR(clk)) { |
diff --git a/drivers/usb/phy/mv_u3d_phy.c b/drivers/usb/phy/mv_u3d_phy.c index eaddbe3d4304..9d8599122aa9 100644 --- a/drivers/usb/phy/mv_u3d_phy.c +++ b/drivers/usb/phy/mv_u3d_phy.c | |||
@@ -283,11 +283,9 @@ static int mv_u3d_phy_probe(struct platform_device *pdev) | |||
283 | return -ENODEV; | 283 | return -ENODEV; |
284 | } | 284 | } |
285 | 285 | ||
286 | phy_base = devm_request_and_ioremap(dev, res); | 286 | phy_base = devm_ioremap_resource(dev, res); |
287 | if (!phy_base) { | 287 | if (IS_ERR(phy_base)) |
288 | dev_err(dev, "%s: register mapping failed\n", __func__); | 288 | return PTR_ERR(phy_base); |
289 | return -ENXIO; | ||
290 | } | ||
291 | 289 | ||
292 | mv_u3d_phy = devm_kzalloc(dev, sizeof(*mv_u3d_phy), GFP_KERNEL); | 290 | mv_u3d_phy = devm_kzalloc(dev, sizeof(*mv_u3d_phy), GFP_KERNEL); |
293 | if (!mv_u3d_phy) | 291 | if (!mv_u3d_phy) |
diff --git a/drivers/usb/phy/omap-usb2.c b/drivers/usb/phy/omap-usb2.c index 26ae8f49225c..2fdb8ede5f1c 100644 --- a/drivers/usb/phy/omap-usb2.c +++ b/drivers/usb/phy/omap-usb2.c | |||
@@ -168,11 +168,9 @@ static int omap_usb2_probe(struct platform_device *pdev) | |||
168 | 168 | ||
169 | res = platform_get_resource(pdev, IORESOURCE_MEM, 1); | 169 | res = platform_get_resource(pdev, IORESOURCE_MEM, 1); |
170 | 170 | ||
171 | phy->control_dev = devm_request_and_ioremap(&pdev->dev, res); | 171 | phy->control_dev = devm_ioremap_resource(&pdev->dev, res); |
172 | if (phy->control_dev == NULL) { | 172 | if (IS_ERR(phy->control_dev)) |
173 | dev_err(&pdev->dev, "Failed to obtain io memory\n"); | 173 | return PTR_ERR(phy->control_dev); |
174 | return -ENXIO; | ||
175 | } | ||
176 | 174 | ||
177 | phy->is_suspended = 1; | 175 | phy->is_suspended = 1; |
178 | omap_usb_phy_power(phy, 0); | 176 | omap_usb_phy_power(phy, 0); |
diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c index 38bce046f4d0..cfd205036aba 100644 --- a/drivers/usb/renesas_usbhs/common.c +++ b/drivers/usb/renesas_usbhs/common.c | |||
@@ -14,6 +14,7 @@ | |||
14 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | 14 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
15 | * | 15 | * |
16 | */ | 16 | */ |
17 | #include <linux/err.h> | ||
17 | #include <linux/io.h> | 18 | #include <linux/io.h> |
18 | #include <linux/module.h> | 19 | #include <linux/module.h> |
19 | #include <linux/pm_runtime.h> | 20 | #include <linux/pm_runtime.h> |
@@ -443,11 +444,9 @@ static int usbhs_probe(struct platform_device *pdev) | |||
443 | return -ENOMEM; | 444 | return -ENOMEM; |
444 | } | 445 | } |
445 | 446 | ||
446 | priv->base = devm_request_and_ioremap(&pdev->dev, res); | 447 | priv->base = devm_ioremap_resource(&pdev->dev, res); |
447 | if (!priv->base) { | 448 | if (IS_ERR(priv->base)) |
448 | dev_err(&pdev->dev, "ioremap error.\n"); | 449 | return PTR_ERR(priv->base); |
449 | return -ENOMEM; | ||
450 | } | ||
451 | 450 | ||
452 | /* | 451 | /* |
453 | * care platform info | 452 | * care platform info |