提交 f1f802c9 编写于 作者: S Shawn Guo

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: NShawn Guo <shawn.guo@linaro.org>
Cc: Huang Shijie <b32955@freescale.com>
Cc: Artem Bityutskiy <artem.bityutskiy@intel.com>
Acked-by: NMarek Vasut <marek.vasut@gmail.com>
上级 efdfc52c
......@@ -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 @@ void gpmi_begin(struct gpmi_nand_data *this)
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. */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册