From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Li Zetao <lizetao1@huawei.com>
Cc: <computersforpeace@gmail.com>, <kamal.dasu@broadcom.com>,
<bcm-kernel-feedback-list@broadcom.com>, <richard@nod.at>,
<vigneshr@ti.com>, <william.zhang@broadcom.com>,
<anand.gore@broadcom.com>, <kursad.oney@broadcom.com>,
<florian.fainelli@broadcom.com>, <rafal@milecki.pl>,
<rjui@broadcom.com>, <sbranden@broadcom.com>,
<linux-mtd@lists.infradead.org>,
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH -next] mtd: nand: Use devm_platform_ioremap_resource_byname()
Date: Tue, 1 Aug 2023 17:43:21 +0200 [thread overview]
Message-ID: <20230801174321.4fceefaa@xps-13> (raw)
In-Reply-To: <20230801134619.416618-1-lizetao1@huawei.com>
Hi Li,
lizetao1@huawei.com wrote on Tue, 1 Aug 2023 21:46:19 +0800:
> Convert platform_get_resource_byname() + devm_ioremap_resource() to a
> single call to devm_platform_ioremap_resource_byname(), as this is
> exactly what this function does.
Please use "mtd: rawnand: brcmnand:" for the prefix.
>
> Signed-off-by: Li Zetao <lizetao1@huawei.com>
> ---
> drivers/mtd/nand/raw/brcmnand/bcm63138_nand.c | 4 +---
> drivers/mtd/nand/raw/brcmnand/iproc_nand.c | 7 ++-----
> 2 files changed, 3 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/mtd/nand/raw/brcmnand/bcm63138_nand.c b/drivers/mtd/nand/raw/brcmnand/bcm63138_nand.c
> index 71ddcc611f6e..9596629000f4 100644
> --- a/drivers/mtd/nand/raw/brcmnand/bcm63138_nand.c
> +++ b/drivers/mtd/nand/raw/brcmnand/bcm63138_nand.c
> @@ -61,15 +61,13 @@ static int bcm63138_nand_probe(struct platform_device *pdev)
> struct device *dev = &pdev->dev;
> struct bcm63138_nand_soc *priv;
> struct brcmnand_soc *soc;
> - struct resource *res;
>
> priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
> if (!priv)
> return -ENOMEM;
> soc = &priv->soc;
>
> - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "nand-int-base");
> - priv->base = devm_ioremap_resource(dev, res);
> + priv->base = devm_platform_ioremap_resource_byname(pdev, "nand-int-base");
> if (IS_ERR(priv->base))
> return PTR_ERR(priv->base);
>
> diff --git a/drivers/mtd/nand/raw/brcmnand/iproc_nand.c b/drivers/mtd/nand/raw/brcmnand/iproc_nand.c
> index d32950847a62..089c70fc6edf 100644
> --- a/drivers/mtd/nand/raw/brcmnand/iproc_nand.c
> +++ b/drivers/mtd/nand/raw/brcmnand/iproc_nand.c
> @@ -103,7 +103,6 @@ static int iproc_nand_probe(struct platform_device *pdev)
> struct device *dev = &pdev->dev;
> struct iproc_nand_soc *priv;
> struct brcmnand_soc *soc;
> - struct resource *res;
>
> priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
> if (!priv)
> @@ -112,13 +111,11 @@ static int iproc_nand_probe(struct platform_device *pdev)
>
> spin_lock_init(&priv->idm_lock);
>
> - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "iproc-idm");
> - priv->idm_base = devm_ioremap_resource(dev, res);
> + priv->idm_base = devm_platform_ioremap_resource_byname(pdev, "iproc-idm");
> if (IS_ERR(priv->idm_base))
> return PTR_ERR(priv->idm_base);
>
> - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "iproc-ext");
> - priv->ext_base = devm_ioremap_resource(dev, res);
> + priv->ext_base = devm_platform_ioremap_resource_byname(pdev, "iproc-ext");
> if (IS_ERR(priv->ext_base))
> return PTR_ERR(priv->ext_base);
>
Thanks,
Miquèl
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-08-01 15:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-01 13:46 [PATCH -next] mtd: nand: Use devm_platform_ioremap_resource_byname() Li Zetao
2023-08-01 15:43 ` Miquel Raynal [this message]
2023-08-02 1:35 ` [PATCH -next v2] mtd: rawnand: brcmnand: " Li Zetao
2023-08-02 17:03 ` Florian Fainelli
2023-08-04 7:03 ` Miquel Raynal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230801174321.4fceefaa@xps-13 \
--to=miquel.raynal@bootlin.com \
--cc=anand.gore@broadcom.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=computersforpeace@gmail.com \
--cc=florian.fainelli@broadcom.com \
--cc=kamal.dasu@broadcom.com \
--cc=kursad.oney@broadcom.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mtd@lists.infradead.org \
--cc=lizetao1@huawei.com \
--cc=rafal@milecki.pl \
--cc=richard@nod.at \
--cc=rjui@broadcom.com \
--cc=sbranden@broadcom.com \
--cc=vigneshr@ti.com \
--cc=william.zhang@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).