[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAEExFWtgXt2pGM1fGfmxNdk_7S_53gnhN0-bProWA4-vOaNN3w@mail.gmail.com>
Date: Sun, 15 Dec 2019 20:00:01 +0800
From: Frank Lee <tiny.windzz@...il.com>
To: Marc Zyngier <maz@...nel.org>
Cc: khilman@...libre.com, leoyang.li@....com, khalasa@...p.pl,
john@...ozen.org, Matthias Brugger <matthias.bgg@...il.com>,
agross@...nel.org, bjorn.andersson@...aro.org, kgene@...nel.org,
krzk@...nel.org, Maxime Ripard <mripard@...nel.org>,
Chen-Yu Tsai <wens@...e.org>, ssantosh@...nel.org,
jun.nie@...aro.org, shawnguo@...nel.org,
linux-samsung-soc@...r.kernel.org, linux-arm-msm@...r.kernel.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-mips@...r.kernel.org, linux-mediatek@...ts.infradead.org,
linux-amlogic@...ts.infradead.org, linuxppc-dev@...ts.ozlabs.org,
Linux ARM <linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH 10/10] soc: qcom: convert to devm_platform_ioremap_resource
On Sun, Dec 15, 2019 at 6:48 PM Marc Zyngier <maz@...nel.org> wrote:
>
> On Sat, 14 Dec 2019 17:54:47 +0000
> Yangtao Li <tiny.windzz@...il.com> wrote:
>
> > Use devm_platform_ioremap_resource() to simplify code.
> >
> > Signed-off-by: Yangtao Li <tiny.windzz@...il.com>
> > ---
> > drivers/soc/qcom/llcc-qcom.c | 7 +------
> > drivers/soc/qcom/qcom-geni-se.c | 4 +---
> > drivers/soc/qcom/qcom_aoss.c | 4 +---
> > drivers/soc/qcom/qcom_gsbi.c | 5 +----
> > drivers/soc/qcom/spm.c | 4 +---
> > 5 files changed, 5 insertions(+), 19 deletions(-)
> >
> > diff --git a/drivers/soc/qcom/llcc-qcom.c b/drivers/soc/qcom/llcc-qcom.c
> > index 429b5a60a1ba..99e19df76889 100644
> > --- a/drivers/soc/qcom/llcc-qcom.c
> > +++ b/drivers/soc/qcom/llcc-qcom.c
> > @@ -387,7 +387,6 @@ static int qcom_llcc_remove(struct platform_device *pdev)
> > static struct regmap *qcom_llcc_init_mmio(struct platform_device *pdev,
> > const char *name)
> > {
> > - struct resource *res;
> > void __iomem *base;
> > struct regmap_config llcc_regmap_config = {
> > .reg_bits = 32,
> > @@ -396,11 +395,7 @@ static struct regmap *qcom_llcc_init_mmio(struct platform_device *pdev,
> > .fast_io = true,
> > };
> >
> > - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, name);
> > - if (!res)
> > - return ERR_PTR(-ENODEV);
> > -
> > - base = devm_ioremap_resource(&pdev->dev, res);
> > + base = devm_platform_ioremap_resource(pdev, 0);
>
> What guarantees do you have that entry 0 matches name?
Yeah, this place is wrong. I intruduce another helper.
https://lore.kernel.org/patchwork/patch/1165186/
Thx,
Yangtao
>
> I find these changes pointless: they don't add much to the readability
> or maintainability of the code, and instead introduce creative bugs.
>
> M.
> --
> Jazz is not dead. It just smells funny...
Powered by blists - more mailing lists