* [PATCH] serial: stm32: use devm_platform_get_and_ioremap_resource()
@ 2021-08-14 13:14 ` Tang Bin
0 siblings, 0 replies; 2+ messages in thread
From: Tang Bin @ 2021-08-14 13:14 UTC (permalink / raw)
To: gregkh, jirislaby, mcoquelin.stm32, alexandre.torgue
Cc: linux-serial, linux-stm32, linux-arm-kernel, linux-kernel,
Tang Bin, Zhang Shengju
Use devm_platform_get_and_ioremap_resource() to simplify code.
Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
---
drivers/tty/serial/stm32-usart.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c
index 090822cd1..d4ea86e28 100644
--- a/drivers/tty/serial/stm32-usart.c
+++ b/drivers/tty/serial/stm32-usart.c
@@ -1064,8 +1064,7 @@ static int stm32_usart_init_port(struct stm32_port *stm32port,
&stm32port->txftcfg);
}
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- port->membase = devm_ioremap_resource(&pdev->dev, res);
+ port->membase = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(port->membase))
return PTR_ERR(port->membase);
port->mapbase = res->start;
--
2.20.1.windows.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] serial: stm32: use devm_platform_get_and_ioremap_resource()
@ 2021-08-14 13:14 ` Tang Bin
0 siblings, 0 replies; 2+ messages in thread
From: Tang Bin @ 2021-08-14 13:14 UTC (permalink / raw)
To: gregkh, jirislaby, mcoquelin.stm32, alexandre.torgue
Cc: linux-serial, linux-stm32, linux-arm-kernel, linux-kernel,
Tang Bin, Zhang Shengju
Use devm_platform_get_and_ioremap_resource() to simplify code.
Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
---
drivers/tty/serial/stm32-usart.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c
index 090822cd1..d4ea86e28 100644
--- a/drivers/tty/serial/stm32-usart.c
+++ b/drivers/tty/serial/stm32-usart.c
@@ -1064,8 +1064,7 @@ static int stm32_usart_init_port(struct stm32_port *stm32port,
&stm32port->txftcfg);
}
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- port->membase = devm_ioremap_resource(&pdev->dev, res);
+ port->membase = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(port->membase))
return PTR_ERR(port->membase);
port->mapbase = res->start;
--
2.20.1.windows.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-08-14 13:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-14 13:14 [PATCH] serial: stm32: use devm_platform_get_and_ioremap_resource() Tang Bin
2021-08-14 13:14 ` Tang Bin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.