diff options
author | Jiasheng Jiang <jiasheng@iscas.ac.cn> | 2022-03-08 14:40:07 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-03-09 12:12:46 +0000 |
commit | 6babfc6e6fab068018c36e8f6605184b8c0b349d (patch) | |
tree | cd742685daaf2f22a648d68b8143a235c1543408 | |
parent | 030141b0fce1e823190b07b1a592b5ccdab3f5fd (diff) | |
download | linux-6babfc6e6fab068018c36e8f6605184b8c0b349d.tar.bz2 |
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: 8a2c9a5ab4b9 ("net: ethernet: ti: cpts: rework initialization/deinitialization")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/ti/cpts.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/ti/cpts.c b/drivers/net/ethernet/ti/cpts.c index dc70a6bfaa6a..92ca739fac01 100644 --- a/drivers/net/ethernet/ti/cpts.c +++ b/drivers/net/ethernet/ti/cpts.c @@ -568,7 +568,9 @@ int cpts_register(struct cpts *cpts) for (i = 0; i < CPTS_MAX_EVENTS; i++) 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, TS_PEND_EN, int_enable); |