[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAAfSe-v6F-8F5YtunuHVmZVrGh5vAAFbkYLP1kThqoJd04BmBw@mail.gmail.com>
Date: Thu, 27 Jun 2019 15:52:42 +0800
From: Chunyan Zhang <zhang.lyra@...il.com>
To: Stephen Boyd <sboyd@...nel.org>
Cc: Chunyan Zhang <zhang.chunyan@...aro.org>,
linux-clk <linux-clk@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Orson Zhai <orsonzhai@...il.com>,
Baolin Wang <baolin.wang@...aro.org>
Subject: Re: [PATCH v2 1/3] clk: sprd: Switch from of_iomap() to devm_ioremap_resource()
On Thu, 27 Jun 2019 at 02:16, Stephen Boyd <sboyd@...nel.org> wrote:
>
> Quoting Chunyan Zhang (2019-05-21 18:15:01)
> > devm_ioremap_resources() automatically requests resources and devm_ wrappers
> > do better error handling and unmapping of the I/O region when needed,
> > that would make drivers more clean and simple.
> >
> > Signed-off-by: Chunyan Zhang <zhang.chunyan@...aro.org>
>
> Applied to clk-next
>
> > diff --git a/drivers/clk/sprd/common.c b/drivers/clk/sprd/common.c
> > index e038b0447206..9ce690999eaa 100644
> > --- a/drivers/clk/sprd/common.c
> > +++ b/drivers/clk/sprd/common.c
> > @@ -50,7 +51,11 @@ int sprd_clk_regmap_init(struct platform_device *pdev,
> > return PTR_ERR(regmap);
> > }
> > } else {
> > - base = of_iomap(node, 0);
> > + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > + base = devm_ioremap_resource(&pdev->dev, res);
> > + if (IS_ERR(base))
>
> There's also devm_platform_ioremap_resource() if you want to save even
> more lines!
Yes indeed, thanks for the information.
Considering this patch was queued to your tree, I decide to use this
more integrated function later :)
Cheers,
Chunyan
>
> > + return PTR_ERR(base);
> > +
Powered by blists - more mailing lists