diff options
author | Yangtao Li <frank.li@vivo.com> | 2023-07-12 08:28:43 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-07-25 20:26:06 +0200 |
commit | f9061d3b7899e946f0db6ef7b727c40c01cfbd45 (patch) | |
tree | f56fc629518633b51450d725cc73c173b1e5a8f3 /drivers/tty/serial/serial-tegra.c | |
parent | serial: linflexuart: Use devm_platform_get_and_ioremap_resource() (diff) | |
download | linux-f9061d3b7899e946f0db6ef7b727c40c01cfbd45.tar.xz linux-f9061d3b7899e946f0db6ef7b727c40c01cfbd45.zip |
serial: tegra: 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@vivo.com>
Link: https://lore.kernel.org/r/20230712062853.11007-5-frank.li@vivo.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to '')
-rw-r--r-- | drivers/tty/serial/serial-tegra.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/tty/serial/serial-tegra.c b/drivers/tty/serial/serial-tegra.c index f7f0841d60c9..0b597b282fce 100644 --- a/drivers/tty/serial/serial-tegra.c +++ b/drivers/tty/serial/serial-tegra.c @@ -1577,16 +1577,11 @@ static int tegra_uart_probe(struct platform_device *pdev) tup->cdata = cdata; platform_set_drvdata(pdev, tup); - resource = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!resource) { - dev_err(&pdev->dev, "No IO memory resource\n"); - return -ENODEV; - } - u->mapbase = resource->start; - u->membase = devm_ioremap_resource(&pdev->dev, resource); + u->membase = devm_platform_get_and_ioremap_resource(pdev, 0, &resource); if (IS_ERR(u->membase)) return PTR_ERR(u->membase); + u->mapbase = resource->start; tup->uart_clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(tup->uart_clk)) |