aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2014-01-02 03:24:03 -0500
committerTejun Heo <tj@kernel.org>2014-01-02 07:48:33 -0500
commit3e692a942f6eb0ec0151449e6c5fb88ffc854b6d (patch)
treecb88e42ba0e6bce0650717acd34a7694e4b2f3ba /drivers/ata
parent15e5318c9cb92dc49f1326bce44798575e3b5774 (diff)
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: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/pata_samsung_cf.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/drivers/ata/pata_samsung_cf.c b/drivers/ata/pata_samsung_cf.c
index cd2746b169a9..7d2142fbcbb7 100644
--- a/drivers/ata/pata_samsung_cf.c
+++ b/drivers/ata/pata_samsung_cf.c
@@ -531,22 +531,10 @@ static int __init pata_s3c_probe(struct platform_device *pdev)
531 info->irq = platform_get_irq(pdev, 0); 531 info->irq = platform_get_irq(pdev, 0);
532 532
533 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 533 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
534 if (res == NULL) {
535 dev_err(dev, "failed to get mem resource\n");
536 return -EINVAL;
537 }
538
539 if (!devm_request_mem_region(dev, res->start,
540 resource_size(res), DRV_NAME)) {
541 dev_err(dev, "error requesting register region\n");
542 return -EBUSY;
543 }
544 534
545 info->ide_addr = devm_ioremap(dev, res->start, resource_size(res)); 535 info->ide_addr = devm_ioremap_resource(dev, res);
546 if (!info->ide_addr) { 536 if (IS_ERR(info->ide_addr))
547 dev_err(dev, "failed to map IO base address\n"); 537 return PTR_ERR(info->ide_addr);
548 return -ENOMEM;
549 }
550 538
551 info->clk = devm_clk_get(&pdev->dev, "cfcon"); 539 info->clk = devm_clk_get(&pdev->dev, "cfcon");
552 if (IS_ERR(info->clk)) { 540 if (IS_ERR(info->clk)) {