public inbox for linux-tegra@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 6/7] spi: tegra20-slink: Use devm_platform_get_and_ioremap_resource()
       [not found] <20230706032727.9180-1-frank.li@vivo.com>
@ 2023-07-06  3:27 ` Yangtao Li
  2023-07-07 13:01   ` Thierry Reding
  0 siblings, 1 reply; 2+ messages in thread
From: Yangtao Li @ 2023-07-06  3:27 UTC (permalink / raw)
  To: Laxman Dewangan, Mark Brown, Thierry Reding, Jonathan Hunter
  Cc: Yangtao Li, linux-spi, linux-tegra, linux-kernel

Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 drivers/spi/spi-tegra20-slink.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/spi/spi-tegra20-slink.c b/drivers/spi/spi-tegra20-slink.c
index c2915f7672cc..8cfd9e4f60b5 100644
--- a/drivers/spi/spi-tegra20-slink.c
+++ b/drivers/spi/spi-tegra20-slink.c
@@ -1034,18 +1034,12 @@ static int tegra_slink_probe(struct platform_device *pdev)
 				 &master->max_speed_hz))
 		master->max_speed_hz = 25000000; /* 25MHz */
 
-	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!r) {
-		dev_err(&pdev->dev, "No IO memory resource\n");
-		ret = -ENODEV;
-		goto exit_free_master;
-	}
-	tspi->phys = r->start;
-	tspi->base = devm_ioremap_resource(&pdev->dev, r);
+	tspi->base = devm_platform_get_and_ioremap_resource(pdev, 0, &r);
 	if (IS_ERR(tspi->base)) {
 		ret = PTR_ERR(tspi->base);
 		goto exit_free_master;
 	}
+	tspi->phys = r->start;
 
 	/* disabled clock may cause interrupt storm upon request */
 	tspi->clk = devm_clk_get(&pdev->dev, NULL);
-- 
2.39.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 6/7] spi: tegra20-slink: Use devm_platform_get_and_ioremap_resource()
  2023-07-06  3:27 ` [PATCH 6/7] spi: tegra20-slink: Use devm_platform_get_and_ioremap_resource() Yangtao Li
@ 2023-07-07 13:01   ` Thierry Reding
  0 siblings, 0 replies; 2+ messages in thread
From: Thierry Reding @ 2023-07-07 13:01 UTC (permalink / raw)
  To: Yangtao Li
  Cc: Laxman Dewangan, Mark Brown, Jonathan Hunter, linux-spi,
	linux-tegra, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 446 bytes --]

On Thu, Jul 06, 2023 at 11:27:25AM +0800, Yangtao Li wrote:
> Convert platform_get_resource(), devm_ioremap_resource() to a single
> call to devm_platform_get_and_ioremap_resource(), as this is exactly
> what this function does.
> 
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---
>  drivers/spi/spi-tegra20-slink.c | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)

Acked-by: Thierry Reding <treding@nvidia.com>

[-- 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-07-07 13:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20230706032727.9180-1-frank.li@vivo.com>
2023-07-06  3:27 ` [PATCH 6/7] spi: tegra20-slink: Use devm_platform_get_and_ioremap_resource() Yangtao Li
2023-07-07 13:01   ` Thierry Reding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox