Skip to content

Commit

Permalink
soc: mediatek: mmsys: Use devm_platform_ioremap_resource()
Browse files Browse the repository at this point in the history
For the common platform_get_resource()+devm_platform_ioremap() combination,
there is a helper, so use it and make the code a bit more compact.

Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Reviewed-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Link: https://lore.kernel.org/r/20201006193320.405529-3-enric.balletbo@collabora.com
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
  • Loading branch information
Enric Balletbo i Serra authored and Matthias Brugger committed Nov 27, 2020
1 parent 51c0e61 commit cc65760
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/soc/mediatek/mtk-mmsys.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,15 +306,12 @@ static int mtk_mmsys_probe(struct platform_device *pdev)
struct platform_device *clks;
struct platform_device *drm;
void __iomem *config_regs;
struct resource *mem;
int ret;

mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
config_regs = devm_ioremap_resource(dev, mem);
config_regs = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(config_regs)) {
ret = PTR_ERR(config_regs);
dev_err(dev, "Failed to ioremap mmsys-config resource: %d\n",
ret);
dev_err(dev, "Failed to ioremap mmsys registers: %d\n", ret);
return ret;
}

Expand Down

0 comments on commit cc65760

Please sign in to comment.