提交 970d494c 编写于 作者: T Thierry Reding 提交者: Wolfram Sang

i2c: ocores: Use devm_request_and_ioremap()

Replacing the devm_request_mem_region() and devm_ioremap_nocache() calls
by a single call to devm_request_and_ioremap() simplifies the code.
Signed-off-by: NThierry Reding <thierry.reding@avionic-design.de>
Acked-by: NJean Delvare <khali@linux-fr.org>
Signed-off-by: NWolfram Sang <w.sang@pengutronix.de>
上级 45fd5e4a
......@@ -283,18 +283,9 @@ static int __devinit ocores_i2c_probe(struct platform_device *pdev)
if (!i2c)
return -ENOMEM;
if (!devm_request_mem_region(&pdev->dev, res->start,
resource_size(res), pdev->name)) {
dev_err(&pdev->dev, "Memory region busy\n");
return -EBUSY;
}
i2c->base = devm_ioremap_nocache(&pdev->dev, res->start,
resource_size(res));
if (!i2c->base) {
dev_err(&pdev->dev, "Unable to map registers\n");
return -EIO;
}
i2c->base = devm_request_and_ioremap(&pdev->dev, res);
if (!i2c->base)
return -EADDRNOTAVAIL;
pdata = pdev->dev.platform_data;
if (pdata) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册