From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 85D7EEB64DA for ; Wed, 5 Jul 2023 09:22:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ZCk9E4MobakD6VeLuWD3PN0i9PL2TXQWRhED3kVyR/A=; b=f+xFN+iIdDlTNd CmEV2r5cSKQiqufg2fEzaQhE4sxz2TWi1gNhUAa3Z8hvJgFVEwKmnabk58v4VZnpU9H3iSSjaUrpS qLJpGMRLBVdqq9Ao9ZOH9mn/jk9dxqwktzpWuOXqAv/J3+pB8J48wJ9CrZGK+8fEgDiuwXwLtJwop m4X3qjgzoqePEvHfIlISi94G7nYqF3hq73yjBWOUIAu6bwASqrltGEHzEUqCCgP8KIttyDUlbBJK7 HTaJ11wv2tpAFwMSumE4yrCcYPxD6UAY6Lo28DCRIAr75b1sQEbK6ABuXjSbdf+oEQ7K+T72mTuw8 mSC4iDZtZJsNKG0vvMEw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qGyiT-00FLHT-2A; Wed, 05 Jul 2023 09:22:29 +0000 Received: from madras.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e5ab]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qGyiQ-00FLGQ-21; Wed, 05 Jul 2023 09:22:27 +0000 Received: from [IPV6:2001:b07:2ed:14ed:c5f8:7372:f042:90a2] (unknown [IPv6:2001:b07:2ed:14ed:c5f8:7372:f042:90a2]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id A76BF6606FAB; Wed, 5 Jul 2023 10:22:24 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1688548945; bh=9JHc5dxF9kL0BlFs4YhHrNU5Gaeu5yKjERb1y27tW7k=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=lYRg7E0hTw89N/bxg+8ufv9nqta3h9zrkjkhTlW7yGzVm6qQD3WJFT681azn9O7wk sowieypkzR2oii0YwBNMNwfTAXVOF8hvu56YVVedKnMYxORQv6LlLiy+ml9oZvmb/x GjHPSd7JJv6Usc0mDz/Z8BRyCzvSGaKXBn9d04OsKLcFLUAg6dfzmPJgFDkKxQ5prk 0uQeQkNy5dSQQ/maGZ2O+527IjTcc/SuOYsiP88TK7Idpn+dPlxyqHjyegtW1E0BbT oO5jCvz/D3YcWUH7d+dvxe0PcRVLME4PnVXRGXhhgyTEyxMnondQ/ASbr3S7Wnk6eB ye0DE/X2xVEsw== Message-ID: Date: Wed, 5 Jul 2023 11:22:22 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH 4/4] phy: mediatek: tphy: Convert to devm_platform_ioremap_resource() Content-Language: en-US To: Yangtao Li , Chunfeng Yun , Vinod Koul , Kishon Vijay Abraham I , Matthias Brugger Cc: linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org References: <20230705090126.26854-1-frank.li@vivo.com> <20230705090126.26854-4-frank.li@vivo.com> From: AngeloGioacchino Del Regno In-Reply-To: <20230705090126.26854-4-frank.li@vivo.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230705_022226_798322_CE23EC2D X-CRM114-Status: GOOD ( 17.49 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Il 05/07/23 11:01, Yangtao Li ha scritto: > Use devm_platform_ioremap_resource() to simplify code. > > Signed-off-by: Yangtao Li > --- > 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) That's wrong. You want to return any error unconditionally, as the V1 PHY *needs* the sif iospace and there's nothing afterwards retrying this. Please fix. Regards, Angelo > return PTR_ERR(tphy->sif_base); > - } > } > > if (tphy->pdata->version < MTK_PHY_V3) { _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel