From: Vinod Koul <vkoul@kernel.org>
To: shao.mingyin@zte.com.cn
Cc: miquel.raynal@bootlin.com, jckuo@nvidia.com, kishon@kernel.org,
linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org,
thierry.reding@gmail.com, jonathanh@nvidia.com,
linux-tegra@vger.kernel.org, yang.yang29@zte.com.cn,
xu.xin16@zte.com.cn, ye.xingchen@zte.com.cn,
xie.ludan@zte.com.cn
Subject: Re: [PATCH 1/2] phy: marvell: a3700-comphy: Use devm_platform_ioremap_resource_byname
Date: Fri, 11 Apr 2025 16:50:53 +0530 [thread overview]
Message-ID: <Z/j7FWmvhS83FnrA@vaman> (raw)
In-Reply-To: <20250401193836885cYSO33OlICvYYYmEMlB5J@zte.com.cn>
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
WARNING: multiple messages have this Message-ID (diff)
From: Vinod Koul <vkoul@kernel.org>
To: shao.mingyin@zte.com.cn
Cc: miquel.raynal@bootlin.com, jckuo@nvidia.com, kishon@kernel.org,
linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org,
thierry.reding@gmail.com, jonathanh@nvidia.com,
linux-tegra@vger.kernel.org, yang.yang29@zte.com.cn,
xu.xin16@zte.com.cn, ye.xingchen@zte.com.cn,
xie.ludan@zte.com.cn
Subject: Re: [PATCH 1/2] phy: marvell: a3700-comphy: Use devm_platform_ioremap_resource_byname
Date: Fri, 11 Apr 2025 16:50:53 +0530 [thread overview]
Message-ID: <Z/j7FWmvhS83FnrA@vaman> (raw)
In-Reply-To: <20250401193836885cYSO33OlICvYYYmEMlB5J@zte.com.cn>
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
next prev parent reply other threads:[~2025-04-11 11:28 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-01 11:31 [PATCH 0/2] Use devm_platform_ioremap_resource_byname in phy shao.mingyin
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:38 ` shao.mingyin
2025-04-01 12:31 ` Miquel Raynal
2025-04-01 12:31 ` Miquel Raynal
2025-04-11 11:20 ` Vinod Koul [this message]
2025-04-11 11:20 ` Vinod Koul
2025-04-01 11:40 ` [PATCH 2/2] phy: tegra: xusb: " shao.mingyin
2025-04-01 11:40 ` shao.mingyin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z/j7FWmvhS83FnrA@vaman \
--to=vkoul@kernel.org \
--cc=jckuo@nvidia.com \
--cc=jonathanh@nvidia.com \
--cc=kishon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=linux-tegra@vger.kernel.org \
--cc=miquel.raynal@bootlin.com \
--cc=shao.mingyin@zte.com.cn \
--cc=thierry.reding@gmail.com \
--cc=xie.ludan@zte.com.cn \
--cc=xu.xin16@zte.com.cn \
--cc=yang.yang29@zte.com.cn \
--cc=ye.xingchen@zte.com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.