LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] mtd: spi-nor: hisi-sfc: Make use of the helper function devm_platform_ioremap_resource_byname()
@ 2021-09-01 7:42 Cai Huoqing
2021-09-01 11:40 ` Pratyush Yadav
2021-10-19 10:16 ` Tudor.Ambarus
0 siblings, 2 replies; 3+ messages in thread
From: Cai Huoqing @ 2021-09-01 7:42 UTC (permalink / raw)
To: caihuoqing
Cc: Tudor Ambarus, Michael Walle, Pratyush Yadav, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra, linux-mtd, linux-kernel
Use the devm_platform_ioremap_resource_byname() helper instead of
calling platform_get_resource_byname() and devm_ioremap_resource()
separately
Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
---
drivers/mtd/spi-nor/controllers/hisi-sfc.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/mtd/spi-nor/controllers/hisi-sfc.c b/drivers/mtd/spi-nor/controllers/hisi-sfc.c
index 47fbf1d1e557..5b6d1d994641 100644
--- a/drivers/mtd/spi-nor/controllers/hisi-sfc.c
+++ b/drivers/mtd/spi-nor/controllers/hisi-sfc.c
@@ -421,7 +421,6 @@ static int hisi_spi_nor_register_all(struct hifmc_host *host)
static int hisi_spi_nor_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
- struct resource *res;
struct hifmc_host *host;
int ret;
@@ -432,13 +431,11 @@ static int hisi_spi_nor_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, host);
host->dev = dev;
- res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "control");
- host->regbase = devm_ioremap_resource(dev, res);
+ host->regbase = devm_platform_ioremap_resource_byname(pdev, "control");
if (IS_ERR(host->regbase))
return PTR_ERR(host->regbase);
- res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "memory");
- host->iobase = devm_ioremap_resource(dev, res);
+ host->iobase = devm_platform_ioremap_resource_byname(pdev, "memory");
if (IS_ERR(host->iobase))
return PTR_ERR(host->iobase);
--
2.25.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mtd: spi-nor: hisi-sfc: Make use of the helper function devm_platform_ioremap_resource_byname()
2021-09-01 7:42 [PATCH] mtd: spi-nor: hisi-sfc: Make use of the helper function devm_platform_ioremap_resource_byname() Cai Huoqing
@ 2021-09-01 11:40 ` Pratyush Yadav
2021-10-19 10:16 ` Tudor.Ambarus
1 sibling, 0 replies; 3+ messages in thread
From: Pratyush Yadav @ 2021-09-01 11:40 UTC (permalink / raw)
To: Cai Huoqing
Cc: Tudor Ambarus, Michael Walle, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra, linux-mtd, linux-kernel
On 01/09/21 03:42PM, Cai Huoqing wrote:
> Use the devm_platform_ioremap_resource_byname() helper instead of
> calling platform_get_resource_byname() and devm_ioremap_resource()
> separately
>
> Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
Acked-by: Pratyush Yadav <p.yadav@ti.com>
--
Regards,
Pratyush Yadav
Texas Instruments Inc.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mtd: spi-nor: hisi-sfc: Make use of the helper function devm_platform_ioremap_resource_byname()
2021-09-01 7:42 [PATCH] mtd: spi-nor: hisi-sfc: Make use of the helper function devm_platform_ioremap_resource_byname() Cai Huoqing
2021-09-01 11:40 ` Pratyush Yadav
@ 2021-10-19 10:16 ` Tudor.Ambarus
1 sibling, 0 replies; 3+ messages in thread
From: Tudor.Ambarus @ 2021-10-19 10:16 UTC (permalink / raw)
To: caihuoqing
Cc: michael, p.yadav, miquel.raynal, richard, vigneshr, linux-mtd,
linux-kernel
On 9/1/21 10:42 AM, Cai Huoqing wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> Use the devm_platform_ioremap_resource_byname() helper instead of
> calling platform_get_resource_byname() and devm_ioremap_resource()
> separately
>
> Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
> ---
> drivers/mtd/spi-nor/controllers/hisi-sfc.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-10-19 10:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-01 7:42 [PATCH] mtd: spi-nor: hisi-sfc: Make use of the helper function devm_platform_ioremap_resource_byname() Cai Huoqing
2021-09-01 11:40 ` Pratyush Yadav
2021-10-19 10:16 ` Tudor.Ambarus
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).