[PATCH v3 4/5] usb: dwc2: convert to devm_platform_get_and_ioremap_resource

From: Dejin Zheng
Date: Sun Mar 15 2020 - 10:06:03 EST


Use devm_platform_get_and_ioremap_resource() to simplify code, which
contains platform_get_resource() and devm_ioremap_resource(), it also
get the resource for use by the following code.

Signed-off-by: Dejin Zheng <zhengdejin5@xxxxxxxxx>
---
v2 -> v3:
- call the rename function devm_platform_get_and_ioremap_resource()

v1 -> v2:
- add this patch for add some real users of this function.

drivers/usb/dwc2/platform.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c
index 3c6ce09a6db5..8a68e89749d2 100644
--- a/drivers/usb/dwc2/platform.c
+++ b/drivers/usb/dwc2/platform.c
@@ -392,8 +392,7 @@ static int dwc2_driver_probe(struct platform_device *dev)
return retval;
}

- res = platform_get_resource(dev, IORESOURCE_MEM, 0);
- hsotg->regs = devm_ioremap_resource(&dev->dev, res);
+ hsotg->regs = devm_platform_get_and_ioremap_resource(dev, 0, &res);
if (IS_ERR(hsotg->regs))
return PTR_ERR(hsotg->regs);

--
2.25.0