lkml.org 
[lkml]   [2020]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH V4 net-bugfixs] net/ethernet: Update ret when ptp_clock is ERROR
Date
We always have to update the value of ret, otherwise the error value
may be the previous one. And ptp_clock_register() never return NULL
when PTP_1588_CLOCK enable.

Signed-off-by: Wang Qing <wangqing@vivo.com>
---
drivers/net/ethernet/ti/am65-cpts.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/ti/am65-cpts.c b/drivers/net/ethernet/ti/am65-cpts.c
index 75056c1..b319d45
--- a/drivers/net/ethernet/ti/am65-cpts.c
+++ b/drivers/net/ethernet/ti/am65-cpts.c
@@ -1001,8 +1001,7 @@ struct am65_cpts *am65_cpts_create(struct device *dev, void __iomem *regs,
if (IS_ERR_OR_NULL(cpts->ptp_clock)) {
dev_err(dev, "Failed to register ptp clk %ld\n",
PTR_ERR(cpts->ptp_clock));
- if (!cpts->ptp_clock)
- ret = -ENODEV;
+ ret = PTR_ERR(cpts->ptp_clock);
goto refclk_disable;
}
cpts->phc_index = ptp_clock_index(cpts->ptp_clock);
--
2.7.4
\
 
 \ /
  Last update: 2020-11-11 10:25    [W:0.055 / U:0.748 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site