pata_samsung_cf: Use devm_clk_get()
authorJingoo Han <jg1.han@samsung.com>
Thu, 10 Jan 2013 02:05:06 +0000 (11:05 +0900)
committerJeff Garzik <jgarzik@redhat.com>
Mon, 14 Jan 2013 18:31:19 +0000 (13:31 -0500)
Use devm_clk_get() rather than clk_get() to make cleanup paths
more simple.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/ata/pata_samsung_cf.c

index 63ffb002ec673d3858e36177b8e3ed6bb20e6cca..70b0e01372b3da34564f53352aa075fa1ab39bf1 100644 (file)
@@ -512,7 +512,7 @@ static int __init pata_s3c_probe(struct platform_device *pdev)
                return -ENOMEM;
        }
 
-       info->clk = clk_get(&pdev->dev, "cfcon");
+       info->clk = devm_clk_get(&pdev->dev, "cfcon");
        if (IS_ERR(info->clk)) {
                dev_err(dev, "failed to get access to cf controller clock\n");
                ret = PTR_ERR(info->clk);
@@ -589,7 +589,6 @@ static int __init pata_s3c_probe(struct platform_device *pdev)
 
 stop_clk:
        clk_disable(info->clk);
-       clk_put(info->clk);
        return ret;
 }
 
@@ -601,7 +600,6 @@ static int __exit pata_s3c_remove(struct platform_device *pdev)
        ata_host_detach(host);
 
        clk_disable(info->clk);
-       clk_put(info->clk);
 
        return 0;
 }