mtd: denali_dt: Use devm_clk_get()

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Tue Jan 28 00:59:05 EST 2014


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=2281f7b63ed0a7e230a34303c0e9e8f0264fda6c
Commit:     2281f7b63ed0a7e230a34303c0e9e8f0264fda6c
Parent:     436bf63ba5792f2f7bb5e1a4e8d38df8f1a44edc
Author:     Jingoo Han <jg1.han at samsung.com>
AuthorDate: Thu Dec 26 10:43:11 2013 +0900
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Fri Jan 3 11:22:27 2014 -0800

    mtd: denali_dt: Use devm_clk_get()
    
    Use devm_clk_get() to make cleanup paths simpler.
    
    Signed-off-by: Jingoo Han <jg1.han at samsung.com>
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
 drivers/mtd/nand/denali_dt.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/denali_dt.c b/drivers/mtd/nand/denali_dt.c
index 9253024..babb02c 100644
--- a/drivers/mtd/nand/denali_dt.c
+++ b/drivers/mtd/nand/denali_dt.c
@@ -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;
 }



More information about the linux-mtd-cvs mailing list