diff mbox series

[15/17] phy: phy-stm32-usbphyc: convert to devm_platform_ioremap_resource

Message ID 1603940079-8131-15-git-send-email-chunfeng.yun@mediatek.com (mailing list archive)
State Superseded
Headers show
Series [01/17] phy: allwinner: convert to devm_platform_ioremap_resource(_byname) | expand

Commit Message

Chunfeng Yun Oct. 29, 2020, 2:54 a.m. UTC
Use devm_platform_ioremap_resource to simplify code

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
 drivers/phy/st/phy-stm32-usbphyc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Amelie Delaunay Oct. 29, 2020, 10:20 a.m. UTC | #1
On 10/29/20 3:54 AM, Chunfeng Yun wrote:
> Use devm_platform_ioremap_resource to simplify code
> 
> Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>

Reviewed-by: Amelie Delaunay <amelie.delaunay@st.com>

> ---
>   drivers/phy/st/phy-stm32-usbphyc.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/phy/st/phy-stm32-usbphyc.c b/drivers/phy/st/phy-stm32-usbphyc.c
> index 2b3639cba51a..0ab18f2078db 100644
> --- a/drivers/phy/st/phy-stm32-usbphyc.c
> +++ b/drivers/phy/st/phy-stm32-usbphyc.c
> @@ -311,7 +311,6 @@ static int stm32_usbphyc_probe(struct platform_device *pdev)
>   	struct stm32_usbphyc *usbphyc;
>   	struct device *dev = &pdev->dev;
>   	struct device_node *child, *np = dev->of_node;
> -	struct resource *res;
>   	struct phy_provider *phy_provider;
>   	u32 version;
>   	int ret, port = 0;
> @@ -322,8 +321,7 @@ static int stm32_usbphyc_probe(struct platform_device *pdev)
>   	usbphyc->dev = dev;
>   	dev_set_drvdata(dev, usbphyc);
>   
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	usbphyc->base = devm_ioremap_resource(dev, res);
> +	usbphyc->base = devm_platform_ioremap_resource(pdev, 0);
>   	if (IS_ERR(usbphyc->base))
>   		return PTR_ERR(usbphyc->base);
>   
>
diff mbox series

Patch

diff --git a/drivers/phy/st/phy-stm32-usbphyc.c b/drivers/phy/st/phy-stm32-usbphyc.c
index 2b3639cba51a..0ab18f2078db 100644
--- a/drivers/phy/st/phy-stm32-usbphyc.c
+++ b/drivers/phy/st/phy-stm32-usbphyc.c
@@ -311,7 +311,6 @@  static int stm32_usbphyc_probe(struct platform_device *pdev)
 	struct stm32_usbphyc *usbphyc;
 	struct device *dev = &pdev->dev;
 	struct device_node *child, *np = dev->of_node;
-	struct resource *res;
 	struct phy_provider *phy_provider;
 	u32 version;
 	int ret, port = 0;
@@ -322,8 +321,7 @@  static int stm32_usbphyc_probe(struct platform_device *pdev)
 	usbphyc->dev = dev;
 	dev_set_drvdata(dev, usbphyc);
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	usbphyc->base = devm_ioremap_resource(dev, res);
+	usbphyc->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(usbphyc->base))
 		return PTR_ERR(usbphyc->base);