* [PATCH -next] spi: wpcm-fiu: switch to use devm_platform_ioremap_resource_byname()
@ 2023-08-03 2:14 Yang Yingliang
2023-08-14 8:13 ` Jonathan Neuschäfer
0 siblings, 1 reply; 2+ messages in thread
From: Yang Yingliang @ 2023-08-03 2:14 UTC (permalink / raw)
To: linux-spi; +Cc: j.neuschaefer, broonie, yangyingliang
Use the devm_platform_ioremap_resource_byname() helper instead of
calling platform_get_resource_byname() and devm_ioremap_resource()
separately.
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
drivers/spi/spi-wpcm-fiu.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/spi/spi-wpcm-fiu.c b/drivers/spi/spi-wpcm-fiu.c
index 852ffe013d32..d07a06f49204 100644
--- a/drivers/spi/spi-wpcm-fiu.c
+++ b/drivers/spi/spi-wpcm-fiu.c
@@ -448,8 +448,7 @@ static int wpcm_fiu_probe(struct platform_device *pdev)
fiu = spi_controller_get_devdata(ctrl);
fiu->dev = dev;
- res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "control");
- fiu->regs = devm_ioremap_resource(dev, res);
+ fiu->regs = devm_platform_ioremap_resource_byname(pdev, "control");
if (IS_ERR(fiu->regs)) {
dev_err(dev, "Failed to map registers\n");
return PTR_ERR(fiu->regs);
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next] spi: wpcm-fiu: switch to use devm_platform_ioremap_resource_byname()
2023-08-03 2:14 [PATCH -next] spi: wpcm-fiu: switch to use devm_platform_ioremap_resource_byname() Yang Yingliang
@ 2023-08-14 8:13 ` Jonathan Neuschäfer
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Neuschäfer @ 2023-08-14 8:13 UTC (permalink / raw)
To: Yang Yingliang; +Cc: linux-spi, j.neuschaefer, broonie
[-- Attachment #1: Type: text/plain, Size: 1251 bytes --]
Hello,
thanks for your patch!
On Thu, Aug 03, 2023 at 10:14:28AM +0800, Yang Yingliang wrote:
> Use the devm_platform_ioremap_resource_byname() helper instead of
> calling platform_get_resource_byname() and devm_ioremap_resource()
> separately.
>
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
> drivers/spi/spi-wpcm-fiu.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/spi/spi-wpcm-fiu.c b/drivers/spi/spi-wpcm-fiu.c
> index 852ffe013d32..d07a06f49204 100644
> --- a/drivers/spi/spi-wpcm-fiu.c
> +++ b/drivers/spi/spi-wpcm-fiu.c
> @@ -448,8 +448,7 @@ static int wpcm_fiu_probe(struct platform_device *pdev)
> fiu = spi_controller_get_devdata(ctrl);
> fiu->dev = dev;
>
> - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "control");
> - fiu->regs = devm_ioremap_resource(dev, res);
> + fiu->regs = devm_platform_ioremap_resource_byname(pdev, "control");
Reviewed-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Unfortunately, the other platform_get_resource_byname/devm_ioremap_resource
pair a few lines below can't easily be converted to
devm_platform_ioremap_resource_byname, because resource_size is needed.
Best regards,
Jonathan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-08-14 8:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-03 2:14 [PATCH -next] spi: wpcm-fiu: switch to use devm_platform_ioremap_resource_byname() Yang Yingliang
2023-08-14 8:13 ` Jonathan Neuschäfer
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).