Commit 65713177 authored by YueHaibing's avatar YueHaibing Committed by Linus Walleij

pinctrl: mediatek: use devm_platform_ioremap_resource() to simplify code

Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.
Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20191016141053.23740-1-yuehaibing@huawei.comSigned-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 3bf864e2
...@@ -982,7 +982,6 @@ static const struct mtk_eint_xt mtk_eint_xt = { ...@@ -982,7 +982,6 @@ static const struct mtk_eint_xt mtk_eint_xt = {
static int mtk_eint_init(struct mtk_pinctrl *pctl, struct platform_device *pdev) static int mtk_eint_init(struct mtk_pinctrl *pctl, struct platform_device *pdev)
{ {
struct device_node *np = pdev->dev.of_node; struct device_node *np = pdev->dev.of_node;
struct resource *res;
if (!of_property_read_bool(np, "interrupt-controller")) if (!of_property_read_bool(np, "interrupt-controller"))
return -ENODEV; return -ENODEV;
...@@ -991,8 +990,7 @@ static int mtk_eint_init(struct mtk_pinctrl *pctl, struct platform_device *pdev) ...@@ -991,8 +990,7 @@ static int mtk_eint_init(struct mtk_pinctrl *pctl, struct platform_device *pdev)
if (!pctl->eint) if (!pctl->eint)
return -ENOMEM; return -ENOMEM;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); pctl->eint->base = devm_platform_ioremap_resource(pdev, 0);
pctl->eint->base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(pctl->eint->base)) if (IS_ERR(pctl->eint->base))
return PTR_ERR(pctl->eint->base); return PTR_ERR(pctl->eint->base);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment