diff mbox series

[4/7] usb: dwc3: convert to devm_platform_ioremap_resource_byname

Message ID 1595404275-8449-4-git-send-email-chunfeng.yun@mediatek.com (mailing list archive)
State New, archived
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: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
 drivers/usb/dwc3/dwc3-st.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Patrice CHOTARD July 27, 2020, 12:55 p.m. UTC | #1
Hi Chunfeng

On 7/22/20 9:51 AM, Chunfeng Yun wrote:
> Use devm_platform_ioremap_resource_byname() to simplify code
>
> Cc: Patrice Chotard <patrice.chotard@st.com>
> Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
> ---
>  drivers/usb/dwc3/dwc3-st.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/dwc3/dwc3-st.c b/drivers/usb/dwc3/dwc3-st.c
> index c682420..e733be8 100644
> --- a/drivers/usb/dwc3/dwc3-st.c
> +++ b/drivers/usb/dwc3/dwc3-st.c
> @@ -206,8 +206,8 @@ static int st_dwc3_probe(struct platform_device *pdev)
>  	if (!dwc3_data)
>  		return -ENOMEM;
>  
> -	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "reg-glue");
> -	dwc3_data->glue_base = devm_ioremap_resource(dev, res);
> +	dwc3_data->glue_base =
> +		devm_platform_ioremap_resource_byname(pdev, "reg-glue");
>  	if (IS_ERR(dwc3_data->glue_base))
>  		return PTR_ERR(dwc3_data->glue_base);
>  

Reviewed-by: Patrice Chotard <patrice.chotard@st.com>

Thanks

Patrice
diff mbox series

Patch

diff --git a/drivers/usb/dwc3/dwc3-st.c b/drivers/usb/dwc3/dwc3-st.c
index c682420..e733be8 100644
--- a/drivers/usb/dwc3/dwc3-st.c
+++ b/drivers/usb/dwc3/dwc3-st.c
@@ -206,8 +206,8 @@  static int st_dwc3_probe(struct platform_device *pdev)
 	if (!dwc3_data)
 		return -ENOMEM;
 
-	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "reg-glue");
-	dwc3_data->glue_base = devm_ioremap_resource(dev, res);
+	dwc3_data->glue_base =
+		devm_platform_ioremap_resource_byname(pdev, "reg-glue");
 	if (IS_ERR(dwc3_data->glue_base))
 		return PTR_ERR(dwc3_data->glue_base);