]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: ethernet: ti: cpts: Handle error for clk_enable
authorJiasheng Jiang <jiasheng@iscas.ac.cn>
Tue, 8 Mar 2022 06:40:07 +0000 (14:40 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 9 Mar 2022 12:12:46 +0000 (12:12 +0000)
As the potential failure of the clk_enable(),
it should be better to check it and return error
if fails.

Fixes: 28f5ff373868 ("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>
drivers/net/ethernet/ti/cpts.c

index dc70a6bfaa6a16d7d4d5e6514c58b93b72559adc..92ca739fac01028eb4f47091c5627e9e42c69dd9 100644 (file)
@@ -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);