linux-phy.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Use devm_platform_ioremap_resource_byname in phy
@ 2025-04-01 11:31 shao.mingyin
  2025-04-01 11:38 ` [PATCH 1/2] phy: marvell: a3700-comphy: Use devm_platform_ioremap_resource_byname shao.mingyin
  2025-04-01 11:40 ` [PATCH 2/2] phy: tegra: xusb: " shao.mingyin
  0 siblings, 2 replies; 5+ messages in thread
From: shao.mingyin @ 2025-04-01 11:31 UTC (permalink / raw)
  To: miquel.raynal, jckuo
  Cc: vkoul, kishon, linux-phy, linux-kernel, thierry.reding, jonathanh,
	linux-tegra, shao.mingyin, yang.yang29, xu.xin16, ye.xingchen,
	xie.ludan

From: Xie Ludan <xie.ludan@zte.com.cn>

Introduce devm_platform_ioremap_resource_byname() to simplify resource
retrieval and mapping.This new function consolidates
platform_get_resource_byname() and devm_ioremap_resource() into
a single call, improving code readability and reducing API call overhead.

Xie Ludan (2):
  phy: marvell: a3700-comphy: Use devm_platform_ioremap_resource_byname
  phy: tegra: xusb: Use devm_platform_ioremap_resource_byname

 drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 16 +++++-----------
 drivers/phy/tegra/xusb-tegra186.c            |  4 +---
 2 files changed, 6 insertions(+), 14 deletions(-)

-- 
2.25.1

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

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

* [PATCH 1/2] phy: marvell: a3700-comphy: Use devm_platform_ioremap_resource_byname
  2025-04-01 11:31 [PATCH 0/2] Use devm_platform_ioremap_resource_byname in phy shao.mingyin
@ 2025-04-01 11:38 ` shao.mingyin
  2025-04-01 12:31   ` Miquel Raynal
  2025-04-11 11:20   ` Vinod Koul
  2025-04-01 11:40 ` [PATCH 2/2] phy: tegra: xusb: " shao.mingyin
  1 sibling, 2 replies; 5+ messages in thread
From: shao.mingyin @ 2025-04-01 11:38 UTC (permalink / raw)
  To: miquel.raynal, jckuo
  Cc: vkoul, kishon, linux-phy, linux-kernel, thierry.reding, jonathanh,
	linux-tegra, yang.yang29, xu.xin16, ye.xingchen, xie.ludan

From: Xie Ludan <xie.ludan@zte.com.cn>

Introduce devm_platform_ioremap_resource_byname() to simplify resource
retrieval and mapping.This new function consolidates
platform_get_resource_byname() and devm_ioremap_resource() into
a single call, improving code readability and reducing API call overhead.

Signed-off-by: Xie Ludan <xie.ludan@zte.com.cn>
Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
---
 drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/drivers/phy/marvell/phy-mvebu-a3700-comphy.c b/drivers/phy/marvell/phy-mvebu-a3700-comphy.c
index 1d1db1737422..e629a1a73214 100644
--- a/drivers/phy/marvell/phy-mvebu-a3700-comphy.c
+++ b/drivers/phy/marvell/phy-mvebu-a3700-comphy.c
@@ -1253,26 +1253,20 @@ 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] 5+ messages in thread

* [PATCH 2/2] phy: tegra: xusb: Use devm_platform_ioremap_resource_byname
  2025-04-01 11:31 [PATCH 0/2] Use devm_platform_ioremap_resource_byname in phy shao.mingyin
  2025-04-01 11:38 ` [PATCH 1/2] phy: marvell: a3700-comphy: Use devm_platform_ioremap_resource_byname shao.mingyin
@ 2025-04-01 11:40 ` shao.mingyin
  1 sibling, 0 replies; 5+ messages in thread
From: shao.mingyin @ 2025-04-01 11:40 UTC (permalink / raw)
  To: miquel.raynal, jckuo
  Cc: vkoul, kishon, linux-phy, linux-kernel, thierry.reding, jonathanh,
	linux-tegra, yang.yang29, xu.xin16, ye.xingchen, xie.ludan

From: Xie Ludan <xie.ludan@zte.com.cn>

Introduce devm_platform_ioremap_resource_byname() to simplify resource
retrieval and mapping.This new function consolidates
platform_get_resource_byname() and devm_ioremap_resource() into
a single call, improving code readability and reducing API call overhead.

Signed-off-by: Xie Ludan <xie.ludan@zte.com.cn>
Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
---
 drivers/phy/tegra/xusb-tegra186.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/phy/tegra/xusb-tegra186.c b/drivers/phy/tegra/xusb-tegra186.c
index fae6242aa730..6586472866e2 100644
--- a/drivers/phy/tegra/xusb-tegra186.c
+++ b/drivers/phy/tegra/xusb-tegra186.c
@@ -1485,7 +1485,6 @@ tegra186_xusb_padctl_probe(struct device *dev,
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct tegra186_xusb_padctl *priv;
-	struct resource *res;
 	int err;

 	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
@@ -1495,8 +1494,7 @@ tegra186_xusb_padctl_probe(struct device *dev,
 	priv->base.dev = dev;
 	priv->base.soc = soc;

-	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ao");
-	priv->ao_regs = devm_ioremap_resource(dev, res);
+	priv->ao_regs = devm_platform_ioremap_resource_byname(pdev, "ao");
 	if (IS_ERR(priv->ao_regs))
 		return ERR_CAST(priv->ao_regs);

-- 
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] 5+ messages in thread

* Re: [PATCH 1/2] phy: marvell: a3700-comphy: Use devm_platform_ioremap_resource_byname
  2025-04-01 11:38 ` [PATCH 1/2] phy: marvell: a3700-comphy: Use devm_platform_ioremap_resource_byname shao.mingyin
@ 2025-04-01 12:31   ` Miquel Raynal
  2025-04-11 11:20   ` Vinod Koul
  1 sibling, 0 replies; 5+ messages in thread
From: Miquel Raynal @ 2025-04-01 12:31 UTC (permalink / raw)
  To: shao.mingyin
  Cc: jckuo, vkoul, kishon, linux-phy, linux-kernel, thierry.reding,
	jonathanh, linux-tegra, yang.yang29, xu.xin16, ye.xingchen,
	xie.ludan

On 01/04/2025 at 19:38:36 +08, <shao.mingyin@zte.com.cn> wrote:

> From: Xie Ludan <xie.ludan@zte.com.cn>
>
> Introduce devm_platform_ioremap_resource_byname() to simplify resource
> retrieval and mapping.This new function consolidates
> platform_get_resource_byname() and devm_ioremap_resource() into
> a single call, improving code readability and reducing API call overhead.
>
> Signed-off-by: Xie Ludan <xie.ludan@zte.com.cn>
> Signed-off-by: Shao Mingyin <shao.mingyin@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] 5+ messages in thread

* Re: [PATCH 1/2] phy: marvell: a3700-comphy: Use devm_platform_ioremap_resource_byname
  2025-04-01 11:38 ` [PATCH 1/2] phy: marvell: a3700-comphy: Use devm_platform_ioremap_resource_byname shao.mingyin
  2025-04-01 12:31   ` Miquel Raynal
@ 2025-04-11 11:20   ` Vinod Koul
  1 sibling, 0 replies; 5+ messages in thread
From: Vinod Koul @ 2025-04-11 11:20 UTC (permalink / raw)
  To: shao.mingyin
  Cc: miquel.raynal, jckuo, kishon, linux-phy, linux-kernel,
	thierry.reding, jonathanh, linux-tegra, yang.yang29, xu.xin16,
	ye.xingchen, xie.ludan

On 01-04-25, 19:38, shao.mingyin@zte.com.cn wrote:
> From: Xie Ludan <xie.ludan@zte.com.cn>
> 
> Introduce devm_platform_ioremap_resource_byname() to simplify resource
> retrieval and mapping.This new function consolidates
> platform_get_resource_byname() and devm_ioremap_resource() into
> a single call, improving code readability and reducing API call overhead.
> 
> Signed-off-by: Xie Ludan <xie.ludan@zte.com.cn>
> Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
> ---
>  drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 16 +++++-----------
>  1 file changed, 5 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/phy/marvell/phy-mvebu-a3700-comphy.c b/drivers/phy/marvell/phy-mvebu-a3700-comphy.c
> index 1d1db1737422..e629a1a73214 100644
> --- a/drivers/phy/marvell/phy-mvebu-a3700-comphy.c
> +++ b/drivers/phy/marvell/phy-mvebu-a3700-comphy.c
> @@ -1253,26 +1253,20 @@ static int mvebu_a3700_comphy_probe(struct platform_device *pdev)
> 
>  	spin_lock_init(&priv->lock);
> 
> -	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "comphy");

res is unused so this should lead to warnings by this patch, did you at
least compile test it?

> -	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

-- 
~Vinod

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

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

end of thread, other threads:[~2025-05-12 11:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-01 11:31 [PATCH 0/2] Use devm_platform_ioremap_resource_byname in phy shao.mingyin
2025-04-01 11:38 ` [PATCH 1/2] phy: marvell: a3700-comphy: Use devm_platform_ioremap_resource_byname shao.mingyin
2025-04-01 12:31   ` Miquel Raynal
2025-04-11 11:20   ` Vinod Koul
2025-04-01 11:40 ` [PATCH 2/2] phy: tegra: xusb: " shao.mingyin

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).