From: Shawn Guo Date: Tue, 20 Dec 2011 06:02:05 +0000 (+0800) Subject: mtd: gpmi-lib: convert to clk_prepare/clk_unprepare X-Git-Tag: firefly_0821_release~3680^2~3787^2^2^2~6 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=f1f802c9026da6774a72963178ff7435f539fb09;p=firefly-linux-kernel-4.4.55.git mtd: gpmi-lib: convert to clk_prepare/clk_unprepare The patch converts gpmi nand driver to clk_prepare/clk_unprepare by using helper functions clk_prepare_enable/clk_disable_unprepare. Signed-off-by: Shawn Guo Cc: Huang Shijie Cc: Artem Bityutskiy Acked-by: Marek Vasut --- diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-lib.c b/drivers/mtd/nand/gpmi-nand/gpmi-lib.c index de4db7604a3f..2a56fc6f399a 100644 --- a/drivers/mtd/nand/gpmi-nand/gpmi-lib.c +++ b/drivers/mtd/nand/gpmi-nand/gpmi-lib.c @@ -126,7 +126,7 @@ int gpmi_init(struct gpmi_nand_data *this) struct resources *r = &this->resources; int ret; - ret = clk_enable(r->clock); + ret = clk_prepare_enable(r->clock); if (ret) goto err_out; ret = gpmi_reset_block(r->gpmi_regs, false); @@ -146,7 +146,7 @@ int gpmi_init(struct gpmi_nand_data *this) /* Select BCH ECC. */ writel(BM_GPMI_CTRL1_BCH_MODE, r->gpmi_regs + HW_GPMI_CTRL1_SET); - clk_disable(r->clock); + clk_disable_unprepare(r->clock); return 0; err_out: return ret; @@ -202,7 +202,7 @@ int bch_set_geometry(struct gpmi_nand_data *this) ecc_strength = bch_geo->ecc_strength >> 1; page_size = bch_geo->page_size; - ret = clk_enable(r->clock); + ret = clk_prepare_enable(r->clock); if (ret) goto err_out; @@ -229,7 +229,7 @@ int bch_set_geometry(struct gpmi_nand_data *this) writel(BM_BCH_CTRL_COMPLETE_IRQ_EN, r->bch_regs + HW_BCH_CTRL_SET); - clk_disable(r->clock); + clk_disable_unprepare(r->clock); return 0; err_out: return ret; @@ -704,7 +704,7 @@ void gpmi_begin(struct gpmi_nand_data *this) int ret; /* Enable the clock. */ - ret = clk_enable(r->clock); + ret = clk_prepare_enable(r->clock); if (ret) { pr_err("We failed in enable the clk\n"); goto err_out; @@ -773,7 +773,7 @@ err_out: void gpmi_end(struct gpmi_nand_data *this) { struct resources *r = &this->resources; - clk_disable(r->clock); + clk_disable_unprepare(r->clock); } /* Clears a BCH interrupt. */