Skip to content

Commit

Permalink
dmaengine: mediatek: Use devm_platform_ioremap_resource() in mtk_uart…
Browse files Browse the repository at this point in the history
…_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 <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Vinod Koul <[email protected]>
  • Loading branch information
elfring authored and vinodkoul committed Oct 14, 2019
1 parent 9d68427 commit a7dc0e6
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions drivers/dma/mediatek/mtk-uart-apdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit a7dc0e6

Please sign in to comment.