summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/ti/cpts.c
diff options
context:
space:
mode:
authorKangjie Lu <kjlu@umn.edu>2018-12-26 05:55:37 +0300
committerDavid S. Miller <davem@davemloft.net>2018-12-28 03:20:23 +0300
commit2d822f2dbab7f4c820f72eb8570aacf3f35855bd (patch)
tree9835745e248a97c495b68870c69fe259df3ee740 /drivers/net/ethernet/ti/cpts.c
parent26fd962bde0b15e54234fe762d86bc0349df1de4 (diff)
downloadlinux-2d822f2dbab7f4c820f72eb8570aacf3f35855bd.tar.xz
net: (cpts) fix a missing check of clk_prepare
clk_prepare() could fail, so let's check its status, and if it fails, return its error code upstream. Signed-off-by: Kangjie Lu <kjlu@umn.edu> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/ti/cpts.c')
-rw-r--r--drivers/net/ethernet/ti/cpts.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/ti/cpts.c b/drivers/net/ethernet/ti/cpts.c
index 054f78295d1d..2a9ba4acd7fa 100644
--- a/drivers/net/ethernet/ti/cpts.c
+++ b/drivers/net/ethernet/ti/cpts.c
@@ -590,7 +590,9 @@ struct cpts *cpts_create(struct device *dev, void __iomem *regs,
return ERR_CAST(cpts->refclk);
}
- clk_prepare(cpts->refclk);
+ ret = clk_prepare(cpts->refclk);
+ if (ret)
+ return ERR_PTR(ret);
cpts->cc.read = cpts_systim_read;
cpts->cc.mask = CLOCKSOURCE_MASK(32);