lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230705090126.26854-4-frank.li@vivo.com>
Date:   Wed,  5 Jul 2023 17:01:26 +0800
From:   Yangtao Li <frank.li@...o.com>
To:     Chunfeng Yun <chunfeng.yun@...iatek.com>,
        Vinod Koul <vkoul@...nel.org>,
        Kishon Vijay Abraham I <kishon@...nel.org>,
        Matthias Brugger <matthias.bgg@...il.com>,
        AngeloGioacchino Del Regno 
        <angelogioacchino.delregno@...labora.com>
Cc:     Yangtao Li <frank.li@...o.com>,
        linux-arm-kernel@...ts.infradead.org,
        linux-mediatek@...ts.infradead.org, linux-phy@...ts.infradead.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH 4/4] phy: mediatek: tphy: Convert to devm_platform_ioremap_resource()

Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <frank.li@...o.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ