linux-phy.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] phy: marvell: phy-mvebu-a3700-comphy: use devm_platform_ioremap_resource_byname()
@ 2023-03-22  2:07 ye.xingchen
  2023-03-22  8:30 ` Miquel Raynal
  2023-03-22 12:15 ` Marek Behún
  0 siblings, 2 replies; 3+ messages in thread
From: ye.xingchen @ 2023-03-22  2:07 UTC (permalink / raw)
  To: miquel.raynal; +Cc: kishon, linux-phy, linux-kernel, vkoul

From: Ye Xingchen <ye.xingchen@zte.com.cn>

Convert platform_get_resource_byname(),devm_ioremap_resource() to a single
call to devm_platform_ioremap_resource_byname(), as this is exactly what
this function does.

Signed-off-by: Ye Xingchen <ye.xingchen@zte.com.cn>
---
 drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/drivers/phy/marvell/phy-mvebu-a3700-comphy.c b/drivers/phy/marvell/phy-mvebu-a3700-comphy.c
index d641b345afa3..9aeeedf59f44 100644
--- a/drivers/phy/marvell/phy-mvebu-a3700-comphy.c
+++ b/drivers/phy/marvell/phy-mvebu-a3700-comphy.c
@@ -1241,7 +1241,6 @@ static int mvebu_a3700_comphy_probe(struct platform_device *pdev)
 	struct mvebu_a3700_comphy_priv *priv;
 	struct phy_provider *provider;
 	struct device_node *child;
-	struct resource *res;
 	struct clk *clk;
 	int ret;

@@ -1251,26 +1250,19 @@ static int mvebu_a3700_comphy_probe(struct platform_device *pdev)

 	spin_lock_init(&priv->lock);

-	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "comphy");
-	priv->comphy_regs = devm_ioremap_resource(&pdev->dev, res);
+	priv->comphy_regs = devm_platform_ioremap_resource_byname(pdev, "comphy");
 	if (IS_ERR(priv->comphy_regs))
 		return PTR_ERR(priv->comphy_regs);

-	res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
-					   "lane1_pcie_gbe");
-	priv->lane1_phy_regs = devm_ioremap_resource(&pdev->dev, res);
+	priv->lane1_phy_regs = devm_platform_ioremap_resource_byname(pdev, "lane1_pcie_gbe");
 	if (IS_ERR(priv->lane1_phy_regs))
 		return PTR_ERR(priv->lane1_phy_regs);

-	res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
-					   "lane0_usb3_gbe");
-	priv->lane0_phy_regs = devm_ioremap_resource(&pdev->dev, res);
+	priv->lane0_phy_regs = devm_platform_ioremap_resource_byname(pdev, "lane0_usb3_gbe");
 	if (IS_ERR(priv->lane0_phy_regs))
 		return PTR_ERR(priv->lane0_phy_regs);

-	res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
-					   "lane2_sata_usb3");
-	priv->lane2_phy_indirect = devm_ioremap_resource(&pdev->dev, res);
+	priv->lane2_phy_indirect = devm_platform_ioremap_resource_byname(pdev, "lane2_sata_usb3");
 	if (IS_ERR(priv->lane2_phy_indirect))
 		return PTR_ERR(priv->lane2_phy_indirect);

-- 
2.25.1

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] phy: marvell: phy-mvebu-a3700-comphy: use devm_platform_ioremap_resource_byname()
  2023-03-22  2:07 [PATCH] phy: marvell: phy-mvebu-a3700-comphy: use devm_platform_ioremap_resource_byname() ye.xingchen
@ 2023-03-22  8:30 ` Miquel Raynal
  2023-03-22 12:15 ` Marek Behún
  1 sibling, 0 replies; 3+ messages in thread
From: Miquel Raynal @ 2023-03-22  8:30 UTC (permalink / raw)
  To: ye.xingchen; +Cc: kishon, linux-phy, linux-kernel, vkoul

Hello,

ye.xingchen@zte.com.cn wrote on Wed, 22 Mar 2023 10:07:04 +0800 (CST):

> From: Ye Xingchen <ye.xingchen@zte.com.cn>
> 
> Convert platform_get_resource_byname(),devm_ioremap_resource() to a single
> call to devm_platform_ioremap_resource_byname(), as this is exactly what
> this function does.
> 
> Signed-off-by: Ye Xingchen <ye.xingchen@zte.com.cn>

Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

Thanks,
Miquèl

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] phy: marvell: phy-mvebu-a3700-comphy: use devm_platform_ioremap_resource_byname()
  2023-03-22  2:07 [PATCH] phy: marvell: phy-mvebu-a3700-comphy: use devm_platform_ioremap_resource_byname() ye.xingchen
  2023-03-22  8:30 ` Miquel Raynal
@ 2023-03-22 12:15 ` Marek Behún
  1 sibling, 0 replies; 3+ messages in thread
From: Marek Behún @ 2023-03-22 12:15 UTC (permalink / raw)
  To: ye.xingchen; +Cc: miquel.raynal, kishon, linux-phy, linux-kernel, vkoul

On Wed, 22 Mar 2023 10:07:04 +0800 (CST)
<ye.xingchen@zte.com.cn> wrote:

> From: Ye Xingchen <ye.xingchen@zte.com.cn>
> 
> Convert platform_get_resource_byname(),devm_ioremap_resource() to a single
> call to devm_platform_ioremap_resource_byname(), as this is exactly what
> this function does.
> 
> Signed-off-by: Ye Xingchen <ye.xingchen@zte.com.cn>
> ---
>  drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 16 ++++------------
>  1 file changed, 4 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/phy/marvell/phy-mvebu-a3700-comphy.c b/drivers/phy/marvell/phy-mvebu-a3700-comphy.c
> index d641b345afa3..9aeeedf59f44 100644
> --- a/drivers/phy/marvell/phy-mvebu-a3700-comphy.c
> +++ b/drivers/phy/marvell/phy-mvebu-a3700-comphy.c
> @@ -1241,7 +1241,6 @@ static int mvebu_a3700_comphy_probe(struct platform_device *pdev)
>  	struct mvebu_a3700_comphy_priv *priv;
>  	struct phy_provider *provider;
>  	struct device_node *child;
> -	struct resource *res;
>  	struct clk *clk;
>  	int ret;
> 
> @@ -1251,26 +1250,19 @@ static int mvebu_a3700_comphy_probe(struct platform_device *pdev)
> 
>  	spin_lock_init(&priv->lock);
> 
> -	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "comphy");
> -	priv->comphy_regs = devm_ioremap_resource(&pdev->dev, res);
> +	priv->comphy_regs = devm_platform_ioremap_resource_byname(pdev, "comphy");
>  	if (IS_ERR(priv->comphy_regs))
>  		return PTR_ERR(priv->comphy_regs);
> 
> -	res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
> -					   "lane1_pcie_gbe");
> -	priv->lane1_phy_regs = devm_ioremap_resource(&pdev->dev, res);
> +	priv->lane1_phy_regs = devm_platform_ioremap_resource_byname(pdev, "lane1_pcie_gbe");
>  	if (IS_ERR(priv->lane1_phy_regs))
>  		return PTR_ERR(priv->lane1_phy_regs);
> 
> -	res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
> -					   "lane0_usb3_gbe");
> -	priv->lane0_phy_regs = devm_ioremap_resource(&pdev->dev, res);
> +	priv->lane0_phy_regs = devm_platform_ioremap_resource_byname(pdev, "lane0_usb3_gbe");
>  	if (IS_ERR(priv->lane0_phy_regs))
>  		return PTR_ERR(priv->lane0_phy_regs);
> 
> -	res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
> -					   "lane2_sata_usb3");
> -	priv->lane2_phy_indirect = devm_ioremap_resource(&pdev->dev, res);
> +	priv->lane2_phy_indirect = devm_platform_ioremap_resource_byname(pdev, "lane2_sata_usb3");
>  	if (IS_ERR(priv->lane2_phy_indirect))
>  		return PTR_ERR(priv->lane2_phy_indirect);
> 

Reviewed-by: Marek Behún <kabel@kernel.org>

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-03-22 12:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-22  2:07 [PATCH] phy: marvell: phy-mvebu-a3700-comphy: use devm_platform_ioremap_resource_byname() ye.xingchen
2023-03-22  8:30 ` Miquel Raynal
2023-03-22 12:15 ` Marek Behún

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).