提交 d1cb556c 编写于 作者: M Michał Mirosław 提交者: David Woodhouse

mtd: gpmi-nand: fix error return from gpmi_get_clks()

Signed-off-by: NMichał Mirosław <mirq-linux@rere.qmqm.pl>
Acked-by: NHuang Shijie <b32955@freescale.com>
Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
上级 cf3b55a9
...@@ -473,12 +473,14 @@ static int gpmi_get_clks(struct gpmi_nand_data *this) ...@@ -473,12 +473,14 @@ static int gpmi_get_clks(struct gpmi_nand_data *this)
struct resources *r = &this->resources; struct resources *r = &this->resources;
char **extra_clks = NULL; char **extra_clks = NULL;
struct clk *clk; struct clk *clk;
int i; int err, i;
/* The main clock is stored in the first. */ /* The main clock is stored in the first. */
r->clock[0] = clk_get(this->dev, "gpmi_io"); r->clock[0] = clk_get(this->dev, "gpmi_io");
if (IS_ERR(r->clock[0])) if (IS_ERR(r->clock[0])) {
err = PTR_ERR(r->clock[0]);
goto err_clock; goto err_clock;
}
/* Get extra clocks */ /* Get extra clocks */
if (GPMI_IS_MX6Q(this)) if (GPMI_IS_MX6Q(this))
...@@ -491,8 +493,10 @@ static int gpmi_get_clks(struct gpmi_nand_data *this) ...@@ -491,8 +493,10 @@ static int gpmi_get_clks(struct gpmi_nand_data *this)
break; break;
clk = clk_get(this->dev, extra_clks[i - 1]); clk = clk_get(this->dev, extra_clks[i - 1]);
if (IS_ERR(clk)) if (IS_ERR(clk)) {
err = PTR_ERR(clk);
goto err_clock; goto err_clock;
}
r->clock[i] = clk; r->clock[i] = clk;
} }
...@@ -511,7 +515,7 @@ static int gpmi_get_clks(struct gpmi_nand_data *this) ...@@ -511,7 +515,7 @@ static int gpmi_get_clks(struct gpmi_nand_data *this)
err_clock: err_clock:
dev_dbg(this->dev, "failed in finding the clocks.\n"); dev_dbg(this->dev, "failed in finding the clocks.\n");
gpmi_put_clks(this); gpmi_put_clks(this);
return -ENOMEM; return err;
} }
static int acquire_resources(struct gpmi_nand_data *this) static int acquire_resources(struct gpmi_nand_data *this)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册