Message ID | 20210814131418.13608-1-tangbin@cmss.chinamobile.com |
---|---|
State | New |
Headers | show |
Series | serial: stm32: use devm_platform_get_and_ioremap_resource() | expand |
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;