提交 43960b47 编写于 作者: H Heiner Kallweit 提交者: Linus Walleij

gpio: generic: modernize remapping

Replace devm_request_mem_region / devm_ioremap with devm_ioremap_resource.
Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
上级 cf3f2a2c
......@@ -582,9 +582,7 @@ static void __iomem *bgpio_map(struct platform_device *pdev,
resource_size_t sane_sz,
int *err)
{
struct device *dev = &pdev->dev;
struct resource *r;
resource_size_t start;
resource_size_t sz;
void __iomem *ret;
......@@ -602,15 +600,9 @@ static void __iomem *bgpio_map(struct platform_device *pdev,
return NULL;
}
start = r->start;
if (!devm_request_mem_region(dev, start, sz, r->name)) {
*err = -EBUSY;
return NULL;
}
ret = devm_ioremap(dev, start, sz);
if (!ret) {
*err = -ENOMEM;
ret = devm_ioremap_resource(&pdev->dev, r);
if (IS_ERR(ret)) {
*err = PTR_ERR(ret);
return NULL;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册