Commit 6babfc6e authored by Jiasheng Jiang's avatar Jiasheng Jiang Committed by David S. Miller

net: ethernet: ti: cpts: Handle error for clk_enable

As the potential failure of the clk_enable(),
it should be better to check it and return error
if fails.

Fixes: 8a2c9a5a ("net: ethernet: ti: cpts: rework initialization/deinitialization")
Signed-off-by: default avatarJiasheng Jiang <jiasheng@iscas.ac.cn>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 030141b0
...@@ -568,7 +568,9 @@ int cpts_register(struct cpts *cpts) ...@@ -568,7 +568,9 @@ int cpts_register(struct cpts *cpts)
for (i = 0; i < CPTS_MAX_EVENTS; i++) for (i = 0; i < CPTS_MAX_EVENTS; i++)
list_add(&cpts->pool_data[i].list, &cpts->pool); list_add(&cpts->pool_data[i].list, &cpts->pool);
clk_enable(cpts->refclk); err = clk_enable(cpts->refclk);
if (err)
return err;
cpts_write32(cpts, CPTS_EN, control); cpts_write32(cpts, CPTS_EN, control);
cpts_write32(cpts, TS_PEND_EN, int_enable); cpts_write32(cpts, TS_PEND_EN, int_enable);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment