summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2019-09-22 13:07:41 +0200
committerVinod Koul <vkoul@kernel.org>2019-10-14 13:21:20 +0530
commita7dc0e6c1ec9f2f244f3cea3172bfe1521dabcfd (patch)
tree117a6f451c5210263ee77a9e93bc97e13e737feb
parent9d68427d0f4f6c008a26a0a021ee37994549cbc1 (diff)
downloadlinux-a7dc0e6c1ec9f2f244f3cea3172bfe1521dabcfd.tar.gz
linux-a7dc0e6c1ec9f2f244f3cea3172bfe1521dabcfd.tar.bz2
linux-a7dc0e6c1ec9f2f244f3cea3172bfe1521dabcfd.zip
dmaengine: mediatek: Use devm_platform_ioremap_resource() in mtk_uart_apdma_probe()
Simplify this function implementation by using a known wrapper function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Link: https://lore.kernel.org/r/366e776c-8760-eeb7-c248-7380c9f4fd34@web.de Signed-off-by: Vinod Koul <vkoul@kernel.org>
-rw-r--r--drivers/dma/mediatek/mtk-uart-apdma.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/dma/mediatek/mtk-uart-apdma.c b/drivers/dma/mediatek/mtk-uart-apdma.c
index f40051d6aecb..c20e6bd4e298 100644
--- a/drivers/dma/mediatek/mtk-uart-apdma.c
+++ b/drivers/dma/mediatek/mtk-uart-apdma.c
@@ -475,7 +475,6 @@ static int mtk_uart_apdma_probe(struct platform_device *pdev)
struct device_node *np = pdev->dev.of_node;
struct mtk_uart_apdmadev *mtkd;
int bit_mask = 32, rc;
- struct resource *res;
struct mtk_chan *c;
unsigned int i;
@@ -532,13 +531,7 @@ static int mtk_uart_apdma_probe(struct platform_device *pdev)
goto err_no_dma;
}
- res = platform_get_resource(pdev, IORESOURCE_MEM, i);
- if (!res) {
- rc = -ENODEV;
- goto err_no_dma;
- }
-
- c->base = devm_ioremap_resource(&pdev->dev, res);
+ c->base = devm_platform_ioremap_resource(pdev, i);
if (IS_ERR(c->base)) {
rc = PTR_ERR(c->base);
goto err_no_dma;