[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20230704095543.32812-1-frank.li@vivo.com>
Date: Tue, 4 Jul 2023 17:55:43 +0800
From: Yangtao Li <frank.li@...o.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Yangtao Li <frank.li@...o.com>, linux-staging@...ts.linux.dev,
linux-kernel@...r.kernel.org
Subject: [PATCH] staging: axis-fifo: Use devm_platform_get_and_ioremap_resource()
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@...o.com>
---
drivers/staging/axis-fifo/axis-fifo.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/drivers/staging/axis-fifo/axis-fifo.c b/drivers/staging/axis-fifo/axis-fifo.c
index 98db47cb4fa4..0bfe272ba819 100644
--- a/drivers/staging/axis-fifo/axis-fifo.c
+++ b/drivers/staging/axis-fifo/axis-fifo.c
@@ -839,16 +839,8 @@ static int axis_fifo_probe(struct platform_device *pdev)
* ----------------------------
*/
- /* get iospace for the device */
- r_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!r_mem) {
- dev_err(fifo->dt_device, "invalid address\n");
- rc = -ENODEV;
- goto err_initial;
- }
-
- /* request physical memory */
- fifo->base_addr = devm_ioremap_resource(fifo->dt_device, r_mem);
+ /* get iospace for the device and request physical memory */
+ fifo->base_addr = devm_platform_get_and_ioremap_resource(pdev, 0, &r_mem);
if (IS_ERR(fifo->base_addr)) {
rc = PTR_ERR(fifo->base_addr);
goto err_initial;
--
2.39.0
Powered by blists - more mailing lists