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=-10.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 517DBC56201 for ; Thu, 29 Oct 2020 16:50:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E89B420EDD for ; Thu, 29 Oct 2020 16:50:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603990239; bh=p2XKSDtYtyNvK+Jy+l0zHV1d4qZKjBkOsTgt7dXqfyg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=in9BKLdCawgVhViOKoguEj9uR4kWoWL9znIT99vCS9H4yq2DhTKlV9i51IZS9nZLU SKJkO/dUJ3yTfW1JraUDDboqL68aQvtQ2l3qTD36Sk2woQgIR2V1VhoTJuayRfJSMD QT/2pIJplvkeo6/hPE1QFYcReOPm3qJLm9m3/5Ug= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727112AbgJ2Qui (ORCPT ); Thu, 29 Oct 2020 12:50:38 -0400 Received: from mail-ej1-f65.google.com ([209.85.218.65]:35424 "EHLO mail-ej1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726655AbgJ2Quf (ORCPT ); Thu, 29 Oct 2020 12:50:35 -0400 Received: by mail-ej1-f65.google.com with SMTP id p5so4788271ejj.2 for ; Thu, 29 Oct 2020 09:50:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=uBrxBRxxTarAjthI/6yYbLkWUG8wKNojoQzE7DEDDlo=; b=CDhexATO+3fUxzst2rqN1bkvnwMv7yPK65fPygSd0EjgPIpFA/IGyfPYmniUrYdyk1 CqG2FWiEHsClVxiXmwbBMNnLcZ2lmkidOnrYRhSCNRcFJhx4uo84K1ZSlBTAZceJKWjY 8inYhHQih0ckN+aUut5hvxsFVvCXroCXPvBD3dFmB3FGvGPZP36DjyRXj/eR5h+lUeei esJJv/SMl5uSkckwXviRoJmJhJ8uCSKySy5Y+a9O5QSCHtT0+1kH8ggG5l2/X7o8oaii QS8lLgy5YozReDH9NWnx9EwKNCRkIgMN6mytRbsUZ8glsX1/B75mDClk+gMx/NNGQYoX KBxA== X-Gm-Message-State: AOAM532kqCLELpaifhYPVLJaXup7coiHeocYJQaug259N+v8iIdF+Lmr HDc6CPKEXT1nP1mVaaOC5GU= X-Google-Smtp-Source: ABdhPJyzrn9eK+i1/M24SroHeDBR18Gy84aE59n8TsOlqmQWsOXPr7AJa0EMWD1bhAmWao4JQaAnkA== X-Received: by 2002:a17:907:40c2:: with SMTP id nv2mr4711715ejb.337.1603990233349; Thu, 29 Oct 2020 09:50:33 -0700 (PDT) Received: from kozik-lap (adsl-84-226-167-205.adslplus.ch. [84.226.167.205]) by smtp.googlemail.com with ESMTPSA id dm8sm1845090edb.57.2020.10.29.09.50.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Oct 2020 09:50:32 -0700 (PDT) Date: Thu, 29 Oct 2020 17:50:29 +0100 From: Krzysztof Kozlowski 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 , Colin Ian King , Ondrej Jirman , Rikard Falkeborn , Icenowy Zheng , Remi Pommarel , 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 14/17] phy: samsung: convert to devm_platform_ioremap_resource Message-ID: <20201029165029.GA84818@kozik-lap> References: <1603940079-8131-1-git-send-email-chunfeng.yun@mediatek.com> <1603940079-8131-14-git-send-email-chunfeng.yun@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1603940079-8131-14-git-send-email-chunfeng.yun@mediatek.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 29, 2020 at 10:54:36AM +0800, Chunfeng Yun wrote: > Use devm_platform_ioremap_resource to simplify code > > Signed-off-by: Chunfeng Yun > --- Reviewed-by: Krzysztof Kozlowski Best regards, Krzysztof > drivers/phy/samsung/phy-exynos-pcie.c | 7 ++----- > drivers/phy/samsung/phy-exynos5-usbdrd.c | 4 +--- > drivers/phy/samsung/phy-exynos5250-sata.c | 5 +---- > drivers/phy/samsung/phy-samsung-usb2.c | 4 +--- > 4 files changed, 5 insertions(+), 15 deletions(-) > > diff --git a/drivers/phy/samsung/phy-exynos-pcie.c b/drivers/phy/samsung/phy-exynos-pcie.c > index 7e28b1aea0d1..c98fff5c1ac8 100644 > --- a/drivers/phy/samsung/phy-exynos-pcie.c > +++ b/drivers/phy/samsung/phy-exynos-pcie.c > @@ -232,7 +232,6 @@ static int exynos_pcie_phy_probe(struct platform_device *pdev) > struct exynos_pcie_phy *exynos_phy; > struct phy *generic_phy; > struct phy_provider *phy_provider; > - struct resource *res; > const struct exynos_pcie_phy_data *drv_data; > > drv_data = of_device_get_match_data(dev); > @@ -243,13 +242,11 @@ static int exynos_pcie_phy_probe(struct platform_device *pdev) > if (!exynos_phy) > return -ENOMEM; > > - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > - exynos_phy->phy_base = devm_ioremap_resource(dev, res); > + exynos_phy->phy_base = devm_platform_ioremap_resource(pdev, 0); > if (IS_ERR(exynos_phy->phy_base)) > return PTR_ERR(exynos_phy->phy_base); > > - res = platform_get_resource(pdev, IORESOURCE_MEM, 1); > - exynos_phy->blk_base = devm_ioremap_resource(dev, res); > + exynos_phy->blk_base = devm_platform_ioremap_resource(pdev, 1); > if (IS_ERR(exynos_phy->blk_base)) > return PTR_ERR(exynos_phy->blk_base); > > diff --git a/drivers/phy/samsung/phy-exynos5-usbdrd.c b/drivers/phy/samsung/phy-exynos5-usbdrd.c > index cfa9b8b7e5ac..ee0848fe8432 100644 > --- a/drivers/phy/samsung/phy-exynos5-usbdrd.c > +++ b/drivers/phy/samsung/phy-exynos5-usbdrd.c > @@ -829,7 +829,6 @@ static int exynos5_usbdrd_phy_probe(struct platform_device *pdev) > struct device_node *node = dev->of_node; > struct exynos5_usbdrd_phy *phy_drd; > struct phy_provider *phy_provider; > - struct resource *res; > const struct exynos5_usbdrd_phy_drvdata *drv_data; > struct regmap *reg_pmu; > u32 pmu_offset; > @@ -843,8 +842,7 @@ static int exynos5_usbdrd_phy_probe(struct platform_device *pdev) > dev_set_drvdata(dev, phy_drd); > phy_drd->dev = dev; > > - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > - phy_drd->reg_phy = devm_ioremap_resource(dev, res); > + phy_drd->reg_phy = devm_platform_ioremap_resource(pdev, 0); > if (IS_ERR(phy_drd->reg_phy)) > return PTR_ERR(phy_drd->reg_phy); > > diff --git a/drivers/phy/samsung/phy-exynos5250-sata.c b/drivers/phy/samsung/phy-exynos5250-sata.c > index 4dd7324d91b2..9ec234243f7c 100644 > --- a/drivers/phy/samsung/phy-exynos5250-sata.c > +++ b/drivers/phy/samsung/phy-exynos5250-sata.c > @@ -162,7 +162,6 @@ static int exynos_sata_phy_probe(struct platform_device *pdev) > { > struct exynos_sata_phy *sata_phy; > struct device *dev = &pdev->dev; > - struct resource *res; > struct phy_provider *phy_provider; > struct device_node *node; > int ret = 0; > @@ -171,9 +170,7 @@ static int exynos_sata_phy_probe(struct platform_device *pdev) > if (!sata_phy) > return -ENOMEM; > > - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > - > - sata_phy->regs = devm_ioremap_resource(dev, res); > + sata_phy->regs = devm_platform_ioremap_resource(pdev, 0); > if (IS_ERR(sata_phy->regs)) > return PTR_ERR(sata_phy->regs); > > diff --git a/drivers/phy/samsung/phy-samsung-usb2.c b/drivers/phy/samsung/phy-samsung-usb2.c > index a3ed3ff04690..f79f605cff79 100644 > --- a/drivers/phy/samsung/phy-samsung-usb2.c > +++ b/drivers/phy/samsung/phy-samsung-usb2.c > @@ -143,7 +143,6 @@ static int samsung_usb2_phy_probe(struct platform_device *pdev) > const struct samsung_usb2_phy_config *cfg; > struct device *dev = &pdev->dev; > struct phy_provider *phy_provider; > - struct resource *mem; > struct samsung_usb2_phy_driver *drv; > int i, ret; > > @@ -167,8 +166,7 @@ static int samsung_usb2_phy_probe(struct platform_device *pdev) > drv->cfg = cfg; > drv->dev = dev; > > - mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); > - drv->reg_phy = devm_ioremap_resource(dev, mem); > + drv->reg_phy = devm_platform_ioremap_resource(pdev, 0); > if (IS_ERR(drv->reg_phy)) { > dev_err(dev, "Failed to map register memory (phy)\n"); > return PTR_ERR(drv->reg_phy); > -- > 2.18.0