Commit 3e692a94 authored by Jingoo Han's avatar Jingoo Han Committed by Tejun Heo

ata: pata_samsung_cf: Use devm_ioremap_resource()

Use devm_ioremap_resource() in order to make the code simpler,
and remove redundant return value check of platform_get_resource()
because the value is checked by devm_ioremap_resource().
Signed-off-by: default avatarJingoo Han <jg1.han@samsung.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent 15e5318c
...@@ -531,22 +531,10 @@ static int __init pata_s3c_probe(struct platform_device *pdev) ...@@ -531,22 +531,10 @@ static int __init pata_s3c_probe(struct platform_device *pdev)
info->irq = platform_get_irq(pdev, 0); info->irq = platform_get_irq(pdev, 0);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (res == NULL) {
dev_err(dev, "failed to get mem resource\n");
return -EINVAL;
}
if (!devm_request_mem_region(dev, res->start,
resource_size(res), DRV_NAME)) {
dev_err(dev, "error requesting register region\n");
return -EBUSY;
}
info->ide_addr = devm_ioremap(dev, res->start, resource_size(res)); info->ide_addr = devm_ioremap_resource(dev, res);
if (!info->ide_addr) { if (IS_ERR(info->ide_addr))
dev_err(dev, "failed to map IO base address\n"); return PTR_ERR(info->ide_addr);
return -ENOMEM;
}
info->clk = devm_clk_get(&pdev->dev, "cfcon"); info->clk = devm_clk_get(&pdev->dev, "cfcon");
if (IS_ERR(info->clk)) { if (IS_ERR(info->clk)) {
......
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