[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191211094901.GY28289@pdeschrijver-desktop.Nvidia.com>
Date: Wed, 11 Dec 2019 11:49:01 +0200
From: Peter De Schrijver <pdeschrijver@...dia.com>
To: Yangtao Li <tiny.windzz@...il.com>
CC: <afaerber@...e.de>, <manivannan.sadhasivam@...aro.org>,
<mturquette@...libre.com>, <sboyd@...nel.org>,
<Eugeniy.Paltsev@...opsys.com>, <shawnguo@...nel.org>,
<s.hauer@...gutronix.de>, <kernel@...gutronix.de>,
<festevam@...il.com>, <linux-imx@....com>, <agross@...nel.org>,
<s.nawrocki@...sung.com>, <tomasz.figa@...il.com>,
<cw00.choi@...sung.com>, <kgene@...nel.org>, <krzk@...nel.org>,
<palmer@...ive.com>, <paul.walmsley@...ive.com>,
<dinguyen@...nel.org>, <mripard@...nel.org>, <wens@...e.org>,
<emilio@...pez.com.ar>, <pgaikwad@...dia.com>,
<thierry.reding@...il.com>, <jonathanh@...dia.com>,
<matthias.bgg@...il.com>, <rfontana@...hat.com>,
<gregkh@...uxfoundation.org>, <t-kristo@...com>,
<john@...ozen.org>, <tglx@...utronix.de>, <allison@...utok.net>,
<kstewart@...uxfoundation.org>, <swinslow@...il.com>,
<aisheng.dong@....com>, <robh@...nel.org>, <daniel.baluta@....com>,
<weiyongjun1@...wei.com>, <wangyan.wang@...iatek.com>,
<chunhui.dai@...iatek.com>, <miquel.raynal@...tlin.com>,
<heiko@...ech.de>, <jcmvbkbc@...il.com>, <nsekhar@...com>,
<geert+renesas@...der.be>, <linux-arm-kernel@...ts.infradead.org>,
<linux-clk@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-arm-msm@...r.kernel.org>,
<linux-samsung-soc@...r.kernel.org>,
<linux-riscv@...ts.infradead.org>, <linux-tegra@...r.kernel.org>,
<linux-mediatek@...ts.infradead.org>
Subject: Re: [PATCH 06/17] clk: tegra: convert to
devm_platform_ioremap_resource
On Mon, Dec 09, 2019 at 07:57:38PM +0000, Yangtao Li wrote:
> External email: Use caution opening links or attachments
>
>
Acked-by: Peter De Schrijver <pdeschrijver@...dia.com>
> Use devm_platform_ioremap_resource() to simplify code.
>
> Signed-off-by: Yangtao Li <tiny.windzz@...il.com>
> ---
> drivers/clk/tegra/clk-dfll.c | 34 ++++------------------------------
> 1 file changed, 4 insertions(+), 30 deletions(-)
>
> diff --git a/drivers/clk/tegra/clk-dfll.c b/drivers/clk/tegra/clk-dfll.c
> index c051d92c2bbf..070a2957e119 100644
> --- a/drivers/clk/tegra/clk-dfll.c
> +++ b/drivers/clk/tegra/clk-dfll.c
> @@ -1935,7 +1935,6 @@ static int dfll_fetch_common_params(struct tegra_dfll *td)
> int tegra_dfll_register(struct platform_device *pdev,
> struct tegra_dfll_soc_data *soc)
> {
> - struct resource *mem;
> struct tegra_dfll *td;
> int ret;
>
> @@ -1985,51 +1984,26 @@ int tegra_dfll_register(struct platform_device *pdev,
> return ret;
> }
>
> - mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - if (!mem) {
> - dev_err(td->dev, "no control register resource\n");
> - return -ENODEV;
> - }
> -
> - td->base = devm_ioremap(td->dev, mem->start, resource_size(mem));
> + td->base = devm_platform_ioremap_resource(pdev, 0);
> if (!td->base) {
> dev_err(td->dev, "couldn't ioremap DFLL control registers\n");
> return -ENODEV;
> }
>
> - mem = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> - if (!mem) {
> - dev_err(td->dev, "no i2c_base resource\n");
> - return -ENODEV;
> - }
> -
> - td->i2c_base = devm_ioremap(td->dev, mem->start, resource_size(mem));
> + td->i2c_base = devm_platform_ioremap_resource(pdev, 1);
> if (!td->i2c_base) {
> dev_err(td->dev, "couldn't ioremap i2c_base resource\n");
> return -ENODEV;
> }
>
> - mem = platform_get_resource(pdev, IORESOURCE_MEM, 2);
> - if (!mem) {
> - dev_err(td->dev, "no i2c_controller_base resource\n");
> - return -ENODEV;
> - }
> -
> - td->i2c_controller_base = devm_ioremap(td->dev, mem->start,
> - resource_size(mem));
> + td->i2c_controller_base = devm_platform_ioremap_resource(pdev, 2);
> if (!td->i2c_controller_base) {
> dev_err(td->dev,
> "couldn't ioremap i2c_controller_base resource\n");
> return -ENODEV;
> }
>
> - mem = platform_get_resource(pdev, IORESOURCE_MEM, 3);
> - if (!mem) {
> - dev_err(td->dev, "no lut_base resource\n");
> - return -ENODEV;
> - }
> -
> - td->lut_base = devm_ioremap(td->dev, mem->start, resource_size(mem));
> + td->lut_base = devm_platform_ioremap_resource(pdev, 3);
> if (!td->lut_base) {
> dev_err(td->dev,
> "couldn't ioremap lut_base resource\n");
> --
> 2.17.1
>
Powered by blists - more mailing lists