From 148e11349b0c9c7199fd3096254bd3ea16d59a05 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Mon, 21 Jan 2013 11:09:22 +0100 Subject: 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 Acked-by: Alan Stern Acked-by: Felipe Balbi Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/ohci-platform.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'drivers/usb/host/ohci-platform.c') 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 @@ * * Licensed under the GNU/GPL. See COPYING for details. */ +#include #include #include @@ -127,9 +128,9 @@ static int ohci_platform_probe(struct platform_device *dev) hcd->rsrc_start = res_mem->start; hcd->rsrc_len = resource_size(res_mem); - hcd->regs = devm_request_and_ioremap(&dev->dev, res_mem); - if (!hcd->regs) { - err = -ENOMEM; + hcd->regs = devm_ioremap_resource(&dev->dev, res_mem); + if (IS_ERR(hcd->regs)) { + err = PTR_ERR(hcd->regs); goto err_put_hcd; } err = usb_add_hcd(hcd, irq, IRQF_SHARED); -- cgit v1.2.3-55-g7522