Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp36875953rwd; Tue, 11 Jul 2023 06:51:58 -0700 (PDT) X-Google-Smtp-Source: APBJJlHawzsb4CYBELm7nd7jkmzBhp7SmG36vGwigc0bFHE+9RYaav83CFL/r3GqfwzsQnY80P1N X-Received: by 2002:a05:6a00:2d90:b0:66d:514c:cb33 with SMTP id fb16-20020a056a002d9000b0066d514ccb33mr14743119pfb.6.1689083518165; Tue, 11 Jul 2023 06:51:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689083518; cv=none; d=google.com; s=arc-20160816; b=jN/hH4yoWJgDm922LQ7z0SfqCOkuMNOLI/m0Xwi+zEfG1oq9ck0yspkAnOLqYq2NsF NErb3XDM1eFM+fkZQidFJpv7d0DnXH5K++Eq61zdkd10Akk50pw8/6u0T2O/4dtk2pCY HkEQjT6x24JhZcYDcJA8bVrje0HZ4gN6eqFtPGr42bju5YkePEMCFHKjyL4w1DdW1jvM CmEDbEDpiKVyteIs1D89G5aNQ56DXx5ugyadt+IgnyJKRu1vzLiq8sswNGZNMlNhxsq8 II2v6FMB2fS7B0rZvpobeCPanbo1uMuSt8I49KICPHXhUQHJfyA60WAY3IfEiL0Gdxej TeaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=J8UWeT2cmE+rXZSL9CC2SmOMloH3RV7bI2NkfS5praY=; fh=FeqYTsQJQdb3n3PmR3cFrREmRRLhm7w64cTAj34CVHw=; b=mFMrShU/kaJeyxqcrVAnDbhsSM40s0WqeLuBKp4krDk03luNKTBUyfuuBCXJhgo1Ay NIdgjUCP6exmHAQ3deX8UA2Jn3MZeUgSNCk/V0JoeQ82JEU9iHoywTAw0zrxZv5d4MYQ ODxlwa/pqNZw20SmCxIQhrAW/RGapnqTilWGFwNl7HC8W4kVstYddNwboRtIx2g9eV3K YD7d8VVABHqvb5oQl3rSOk5SyVRe3eEzeYvrzuuJaZuonMsClJXon+qQvh32W4ifycmU ZYZ7RynPECiDIRiJgjrZ+WTzL25xwjcGiHzvF6lr70cElmPXiUfHLgT7N76hayTNoGqG HyMg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sntech.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o3-20020a056a001bc300b0067dd87a586esi1457609pfw.377.2023.07.11.06.51.45; Tue, 11 Jul 2023 06:51:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sntech.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232110AbjGKNjt (ORCPT + 99 others); Tue, 11 Jul 2023 09:39:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232280AbjGKNjo (ORCPT ); Tue, 11 Jul 2023 09:39:44 -0400 Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D608E1700 for ; Tue, 11 Jul 2023 06:39:36 -0700 (PDT) Received: from i53875a50.versanet.de ([83.135.90.80] helo=phil.localnet) by gloria.sntech.de with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qJDaT-0008Kg-GE; Tue, 11 Jul 2023 15:39:29 +0200 From: Heiko Stuebner To: Vinod Koul , Kishon Vijay Abraham I , Yangtao Li Cc: Yangtao Li , linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/4] phy: rockchip: phy-rockchip-typec: Use devm_platform_get_and_ioremap_resource() Date: Tue, 11 Jul 2023 15:39:28 +0200 Message-ID: <4152701.ElGaqSPkdT@phil> In-Reply-To: <20230705090126.26854-2-frank.li@vivo.com> References: <20230705090126.26854-1-frank.li@vivo.com> <20230705090126.26854-2-frank.li@vivo.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_PASS,T_SCC_BODY_TEXT_LINE, T_SPF_HELO_TEMPERROR autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Mittwoch, 5. Juli 2023, 11:01:24 CEST schrieb Yangtao Li: > Convert platform_get_resource(), devm_ioremap_resource() to a single > call to devm_platform_get_and_ioremap_resource(), as this is exactly > what this function does. > > Signed-off-by: Yangtao Li Reviewed-by: Heiko Stuebner Though I guess we should check if the res variable can be removed too. devm_platform_get_and_ioremap_resource() checks for its "res" parameter to be not-NULL. So if nothing in the driver itself is using the actual resource, res could be removed and get replaced by "NULL" when calling devm_platform_get_and_ioremap_resource() Heiko > --- > drivers/phy/rockchip/phy-rockchip-typec.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/phy/rockchip/phy-rockchip-typec.c b/drivers/phy/rockchip/phy-rockchip-typec.c > index 8b1667be4915..4efcb78b0ab1 100644 > --- a/drivers/phy/rockchip/phy-rockchip-typec.c > +++ b/drivers/phy/rockchip/phy-rockchip-typec.c > @@ -1116,8 +1116,7 @@ static int rockchip_typec_phy_probe(struct platform_device *pdev) > return -EINVAL; > } > > - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > - tcphy->base = devm_ioremap_resource(dev, res); > + tcphy->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res); > if (IS_ERR(tcphy->base)) > return PTR_ERR(tcphy->base); > >