Linux-mediatek Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yangtao Li <frank.li@vivo.com>
To: Chunfeng Yun <chunfeng.yun@mediatek.com>,
	Vinod Koul <vkoul@kernel.org>,
	Kishon Vijay Abraham I <kishon@kernel.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>
Cc: Yangtao Li <frank.li@vivo.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org,
	linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: [PATCH 4/4] phy: mediatek: tphy: Convert to devm_platform_ioremap_resource()
Date: Wed,  5 Jul 2023 17:01:26 +0800	[thread overview]
Message-ID: <20230705090126.26854-4-frank.li@vivo.com> (raw)
In-Reply-To: <20230705090126.26854-1-frank.li@vivo.com>

Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 drivers/phy/mediatek/phy-mtk-tphy.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/phy/mediatek/phy-mtk-tphy.c b/drivers/phy/mediatek/phy-mtk-tphy.c
index 0d110e50bbfd..cb7a4e6ea017 100644
--- a/drivers/phy/mediatek/phy-mtk-tphy.c
+++ b/drivers/phy/mediatek/phy-mtk-tphy.c
@@ -1554,7 +1554,6 @@ static int mtk_tphy_probe(struct platform_device *pdev)
 	struct device_node *np = dev->of_node;
 	struct device_node *child_np;
 	struct phy_provider *provider;
-	struct resource *sif_res;
 	struct mtk_tphy *tphy;
 	struct resource res;
 	int port, retval;
@@ -1576,15 +1575,12 @@ static int mtk_tphy_probe(struct platform_device *pdev)
 	tphy->dev = dev;
 	platform_set_drvdata(pdev, tphy);
 
-	sif_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	/* SATA phy of V1 needn't it if not shared with PCIe or USB */
-	if (sif_res && tphy->pdata->version == MTK_PHY_V1) {
+	if (tphy->pdata->version == MTK_PHY_V1) {
 		/* get banks shared by multiple phys */
-		tphy->sif_base = devm_ioremap_resource(dev, sif_res);
-		if (IS_ERR(tphy->sif_base)) {
-			dev_err(dev, "failed to remap sif regs\n");
+		tphy->sif_base = devm_platform_ioremap_resource(pdev, 0);
+		if (IS_ERR(tphy->sif_base) && PTR_ERR(tphy->sif_base) != -EINVAL)
 			return PTR_ERR(tphy->sif_base);
-		}
 	}
 
 	if (tphy->pdata->version < MTK_PHY_V3) {
-- 
2.39.0



       reply	other threads:[~2023-07-05  9:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230705090126.26854-1-frank.li@vivo.com>
2023-07-05  9:01 ` Yangtao Li [this message]
2023-07-05  9:22   ` [PATCH 4/4] phy: mediatek: tphy: Convert to devm_platform_ioremap_resource() AngeloGioacchino Del Regno
2023-07-05  9:30     ` Yangtao Li
2023-07-05 10:00       ` AngeloGioacchino Del Regno
2023-07-11  5:07         ` Vinod Koul
2023-07-11  8:57         ` Chunfeng Yun (云春峰)

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=20230705090126.26854-4-frank.li@vivo.com \
    --to=frank.li@vivo.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=chunfeng.yun@mediatek.com \
    --cc=kishon@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=vkoul@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox