mtd: denali_dt: Use devm_clk_get()
authorJingoo Han <jg1.han@samsung.com>
Thu, 26 Dec 2013 01:43:11 +0000 (10:43 +0900)
committerBrian Norris <computersforpeace@gmail.com>
Fri, 3 Jan 2014 19:22:27 +0000 (11:22 -0800)
Use devm_clk_get() to make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/nand/denali_dt.c

index 92530244e2cbfdf48ecc2aa2282b90d12a98d0ad..babb02c4b2204ed0c5881a3577084c2ea826d5df 100644 (file)
@@ -108,7 +108,7 @@ static int denali_dt_probe(struct platform_device *ofdev)
                denali->dev->dma_mask = NULL;
        }
 
-       dt->clk = clk_get(&ofdev->dev, NULL);
+       dt->clk = devm_clk_get(&ofdev->dev, NULL);
        if (IS_ERR(dt->clk)) {
                dev_err(&ofdev->dev, "no clk available\n");
                return PTR_ERR(dt->clk);
@@ -124,7 +124,6 @@ static int denali_dt_probe(struct platform_device *ofdev)
 
 out_disable_clk:
        clk_disable_unprepare(dt->clk);
-       clk_put(dt->clk);
 
        return ret;
 }
@@ -135,7 +134,6 @@ static int denali_dt_remove(struct platform_device *ofdev)
 
        denali_remove(&dt->denali);
        clk_disable(dt->clk);
-       clk_put(dt->clk);
 
        return 0;
 }