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>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
eb612fa013
commit
148e11349b
@@ -13,6 +13,7 @@
|
||||
*
|
||||
* Licensed under the GNU/GPL. See COPYING for details.
|
||||
*/
|
||||
#include <linux/err.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/usb/ohci_pdriver.h>
|
||||
|
||||
@@ -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);
|
||||
|
Reference in New Issue
Block a user