diff mbox series

[3/7] usb: cdns3: convert to devm_platform_ioremap_resource_byname

Message ID 1595404275-8449-3-git-send-email-chunfeng.yun@mediatek.com (mailing list archive)
State Mainlined
Commit 7e8b59c1fc6bf78b8117efd8d354bcb99efed2ea
Headers show
Series [1/7] usb: mtu3: convert to devm_platform_ioremap_resource_byname | expand

Commit Message

Chunfeng Yun July 22, 2020, 7:51 a.m. UTC
Use devm_platform_ioremap_resource_byname() to simplify code

Cc: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
 drivers/usb/cdns3/core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Peter Chen July 22, 2020, 8:46 a.m. UTC | #1
> Use devm_platform_ioremap_resource_byname() to simplify code
> 
> Cc: Peter Chen <peter.chen@nxp.com>
> Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
> ---
>  drivers/usb/cdns3/core.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c index
> 19bbb5b..24faf60 100644
> --- a/drivers/usb/cdns3/core.c
> +++ b/drivers/usb/cdns3/core.c
> @@ -436,8 +436,7 @@ static int cdns3_probe(struct platform_device *pdev)
>  	if (cdns->dev_irq < 0)
>  		dev_err(dev, "couldn't get peripheral irq\n");
> 
> -	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dev");
> -	regs = devm_ioremap_resource(dev, res);
> +	regs = devm_platform_ioremap_resource_byname(pdev, "dev");
>  	if (IS_ERR(regs))
>  		return PTR_ERR(regs);
>  	cdns->dev_regs	= regs;
> --

Reviewed-by: Peter Chen <peter.chen@nxp.com>

Peter
diff mbox series

Patch

diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c
index 19bbb5b..24faf60 100644
--- a/drivers/usb/cdns3/core.c
+++ b/drivers/usb/cdns3/core.c
@@ -436,8 +436,7 @@  static int cdns3_probe(struct platform_device *pdev)
 	if (cdns->dev_irq < 0)
 		dev_err(dev, "couldn't get peripheral irq\n");
 
-	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dev");
-	regs = devm_ioremap_resource(dev, res);
+	regs = devm_platform_ioremap_resource_byname(pdev, "dev");
 	if (IS_ERR(regs))
 		return PTR_ERR(regs);
 	cdns->dev_regs	= regs;