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 X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB8B9C2D0A3 for ; Thu, 29 Oct 2020 08:34:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8998620757 for ; Thu, 29 Oct 2020 08:34:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728575AbgJ2Iey (ORCPT ); Thu, 29 Oct 2020 04:34:54 -0400 Received: from mslow2.mail.gandi.net ([217.70.178.242]:34352 "EHLO mslow2.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728285AbgJ2Iev (ORCPT ); Thu, 29 Oct 2020 04:34:51 -0400 Received: from relay9-d.mail.gandi.net (unknown [217.70.183.199]) by mslow2.mail.gandi.net (Postfix) with ESMTP id A67C03AE2CE for ; Thu, 29 Oct 2020 08:18:29 +0000 (UTC) X-Originating-IP: 82.66.179.123 Received: from localhost (unknown [82.66.179.123]) (Authenticated sender: repk@triplefau.lt) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 3D55FFF817; Thu, 29 Oct 2020 08:17:56 +0000 (UTC) Date: Thu, 29 Oct 2020 09:24:15 +0100 From: Remi Pommarel To: Chunfeng Yun Cc: Kishon Vijay Abraham I , Vinod Koul , Maxime Ripard , Chen-Yu Tsai , Kevin Hilman , Neil Armstrong , Jerome Brunet , Martin Blumenstingl , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Florian Fainelli , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Lubomir Rintel , Matthias Brugger , Randy Dunlap , Krzysztof Kozlowski , Colin Ian King , Ondrej Jirman , Rikard Falkeborn , Icenowy Zheng , Lorenzo Pieralisi , Yue Wang , Hanjie Lin , Joe Perches , Bharat Gooty , Rayagonda Kokatanur , Peter Chen , Roger Quadros , Jyri Sarha , Sanket Parmar , Anil Varughese , Li Jun , Ma Feng , Wei Yongjun , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: Re: [PATCH 02/17] phy: amlogic: convert to devm_platform_ioremap_resource Message-ID: <20201029082415.GB15700@pilgrim> References: <1603940079-8131-1-git-send-email-chunfeng.yun@mediatek.com> <1603940079-8131-2-git-send-email-chunfeng.yun@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1603940079-8131-2-git-send-email-chunfeng.yun@mediatek.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Thu, Oct 29, 2020 at 10:54:24AM +0800, Chunfeng Yun wrote: > Use devm_platform_ioremap_resource to simplify code > > Signed-off-by: Chunfeng Yun > --- > drivers/phy/amlogic/phy-meson-axg-mipi-pcie-analog.c | 4 +--- > drivers/phy/amlogic/phy-meson-axg-pcie.c | 4 +--- > drivers/phy/amlogic/phy-meson-g12a-usb2.c | 4 +--- > drivers/phy/amlogic/phy-meson-g12a-usb3-pcie.c | 4 +--- > drivers/phy/amlogic/phy-meson-gxl-usb2.c | 4 +--- > 5 files changed, 5 insertions(+), 15 deletions(-) > > diff --git a/drivers/phy/amlogic/phy-meson-axg-mipi-pcie-analog.c b/drivers/phy/amlogic/phy-meson-axg-mipi-pcie-analog.c > index 1431cbf885e1..7d06cda329fb 100644 > --- a/drivers/phy/amlogic/phy-meson-axg-mipi-pcie-analog.c > +++ b/drivers/phy/amlogic/phy-meson-axg-mipi-pcie-analog.c > @@ -126,7 +126,6 @@ static int phy_axg_mipi_pcie_analog_probe(struct platform_device *pdev) > struct phy_axg_mipi_pcie_analog_priv *priv; > struct device_node *np = dev->of_node; > struct regmap *map; > - struct resource *res; > void __iomem *base; > int ret; > > @@ -134,8 +133,7 @@ static int phy_axg_mipi_pcie_analog_probe(struct platform_device *pdev) > if (!priv) > return -ENOMEM; > > - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > - base = devm_ioremap_resource(dev, res); > + base = devm_platform_ioremap_resource(pdev, 0); > if (IS_ERR(base)) { > dev_err(dev, "failed to get regmap base\n"); > return PTR_ERR(base); This patch will conflict with [0] that uses syscon to map those shared resources instead and that is hopefully going to be merged soon. So I think you can skip this file. > diff --git a/drivers/phy/amlogic/phy-meson-axg-pcie.c b/drivers/phy/amlogic/phy-meson-axg-pcie.c > index 377ed0dcd0d9..58a7507a8422 100644 > --- a/drivers/phy/amlogic/phy-meson-axg-pcie.c > +++ b/drivers/phy/amlogic/phy-meson-axg-pcie.c > @@ -129,7 +129,6 @@ static int phy_axg_pcie_probe(struct platform_device *pdev) > struct device *dev = &pdev->dev; > struct phy_axg_pcie_priv *priv; > struct device_node *np = dev->of_node; > - struct resource *res; > void __iomem *base; > int ret; > > @@ -145,8 +144,7 @@ static int phy_axg_pcie_probe(struct platform_device *pdev) > return ret; > } > > - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > - base = devm_ioremap_resource(dev, res); > + base = devm_platform_ioremap_resource(pdev, 0); > if (IS_ERR(base)) > return PTR_ERR(base); > > diff --git a/drivers/phy/amlogic/phy-meson-g12a-usb2.c b/drivers/phy/amlogic/phy-meson-g12a-usb2.c > index b26e30e1afaf..9d1efa0d9394 100644 > --- a/drivers/phy/amlogic/phy-meson-g12a-usb2.c > +++ b/drivers/phy/amlogic/phy-meson-g12a-usb2.c > @@ -292,7 +292,6 @@ static int phy_meson_g12a_usb2_probe(struct platform_device *pdev) > { > struct device *dev = &pdev->dev; > struct phy_provider *phy_provider; > - struct resource *res; > struct phy_meson_g12a_usb2_priv *priv; > struct phy *phy; > void __iomem *base; > @@ -305,8 +304,7 @@ static int phy_meson_g12a_usb2_probe(struct platform_device *pdev) > priv->dev = dev; > platform_set_drvdata(pdev, priv); > > - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > - base = devm_ioremap_resource(dev, res); > + base = devm_platform_ioremap_resource(pdev, 0); > if (IS_ERR(base)) > return PTR_ERR(base); > > diff --git a/drivers/phy/amlogic/phy-meson-g12a-usb3-pcie.c b/drivers/phy/amlogic/phy-meson-g12a-usb3-pcie.c > index 08e322789e59..ebe3d0ddd304 100644 > --- a/drivers/phy/amlogic/phy-meson-g12a-usb3-pcie.c > +++ b/drivers/phy/amlogic/phy-meson-g12a-usb3-pcie.c > @@ -386,7 +386,6 @@ static int phy_g12a_usb3_pcie_probe(struct platform_device *pdev) > struct device *dev = &pdev->dev; > struct device_node *np = dev->of_node; > struct phy_g12a_usb3_pcie_priv *priv; > - struct resource *res; > struct phy_provider *phy_provider; > void __iomem *base; > int ret; > @@ -395,8 +394,7 @@ static int phy_g12a_usb3_pcie_probe(struct platform_device *pdev) > if (!priv) > return -ENOMEM; > > - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > - base = devm_ioremap_resource(dev, res); > + base = devm_platform_ioremap_resource(pdev, 0); > if (IS_ERR(base)) > return PTR_ERR(base); > > diff --git a/drivers/phy/amlogic/phy-meson-gxl-usb2.c b/drivers/phy/amlogic/phy-meson-gxl-usb2.c > index 43ec9bf24abf..875afb2672c7 100644 > --- a/drivers/phy/amlogic/phy-meson-gxl-usb2.c > +++ b/drivers/phy/amlogic/phy-meson-gxl-usb2.c > @@ -230,7 +230,6 @@ static int phy_meson_gxl_usb2_probe(struct platform_device *pdev) > { > struct device *dev = &pdev->dev; > struct phy_provider *phy_provider; > - struct resource *res; > struct phy_meson_gxl_usb2_priv *priv; > struct phy *phy; > void __iomem *base; > @@ -242,8 +241,7 @@ static int phy_meson_gxl_usb2_probe(struct platform_device *pdev) > > platform_set_drvdata(pdev, priv); > > - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > - base = devm_ioremap_resource(dev, res); > + base = devm_platform_ioremap_resource(pdev, 0); > if (IS_ERR(base)) > return PTR_ERR(base); > So without the modification on phy-meson-axg-mipi-pcie-analog.c and FWIW, Reviewed-by: Remi Pommarel Thanks, [0] https://patchwork.kernel.org/project/linux-amlogic/patch/20200915130339.11079-4-narmstrong@baylibre.com/ -- Remi