diff options
author | Tang Bin | 2021-08-14 21:14:18 +0800 |
---|---|---|
committer | Greg Kroah-Hartman | 2021-08-16 18:53:15 +0200 |
commit | 3d881e32e295decbc86f5d920bedae929be5bfb0 (patch) | |
tree | e58b6b6e099b1a45a448c3ebc29aba91a47bcc1d /drivers/tty | |
parent | 59bd4eedf118a0404631038ece6f6a436b98c256 (diff) |
serial: stm32: use devm_platform_get_and_ioremap_resource()
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>
Link: https://lore.kernel.org/r/20210814131418.13608-1-tangbin@cmss.chinamobile.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/stm32-usart.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 99f9038dda5d..8f032e77b954 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; |