提交 09bafc30 编写于 作者: J Jingoo Han 提交者: Linus Walleij

gpio: pl061: Use devm_ioremap_resource()

Use devm_ioremap_resource() in order to make the code simpler.
Signed-off-by: NJingoo Han <jg1.han@samsung.com>
Reviewed-by: NAlexandre Courbot <acourbot@nvidia.com>
Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
上级 2b1f597f
......@@ -302,18 +302,9 @@ static int pl061_probe(struct amba_device *adev, const struct amba_id *id)
irq_base = 0;
}
if (!devm_request_mem_region(dev, adev->res.start,
resource_size(&adev->res), "pl061")) {
dev_err(&adev->dev, "no memory region\n");
return -EBUSY;
}
chip->base = devm_ioremap(dev, adev->res.start,
resource_size(&adev->res));
if (!chip->base) {
dev_err(&adev->dev, "could not remap memory\n");
return -ENOMEM;
}
chip->base = devm_ioremap_resource(dev, &adev->res);
if (IS_ERR(chip->base))
return PTR_ERR(chip->base);
spin_lock_init(&chip->lock);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册