mirror of
https://github.com/torvalds/linux.git
synced 2024-11-16 17:12:06 +00:00
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>
This commit is contained in:
parent
59bd4eedf1
commit
3d881e32e2
@ -1064,8 +1064,7 @@ static int stm32_usart_init_port(struct stm32_port *stm32port,
|
|||||||
&stm32port->txftcfg);
|
&stm32port->txftcfg);
|
||||||
}
|
}
|
||||||
|
|
||||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
port->membase = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
|
||||||
port->membase = devm_ioremap_resource(&pdev->dev, res);
|
|
||||||
if (IS_ERR(port->membase))
|
if (IS_ERR(port->membase))
|
||||||
return PTR_ERR(port->membase);
|
return PTR_ERR(port->membase);
|
||||||
port->mapbase = res->start;
|
port->mapbase = res->start;
|
||||||
|
Loading…
Reference in New Issue
Block a user