Skip to content

Commit 81e329e

Browse files
Wang Qingkuba-moo
authored andcommitted
net: ethernet: ti: am65-cpts: update ret when ptp_clock is ERROR
We always have to update the value of ret, otherwise the error value may be the previous one. Fixes: f6bd595 ("net: ethernet: ti: introduce am654 common platform time sync driver") Signed-off-by: Wang Qing <[email protected]> [[email protected]: fix build warn, subj add fixes tag] Signed-off-by: Grygorii Strashko <[email protected]> Acked-by: Richard Cochran <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 8c07205 commit 81e329e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/net/ethernet/ti/am65-cpts.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,8 +1001,7 @@ struct am65_cpts *am65_cpts_create(struct device *dev, void __iomem *regs,
10011001
if (IS_ERR_OR_NULL(cpts->ptp_clock)) {
10021002
dev_err(dev, "Failed to register ptp clk %ld\n",
10031003
PTR_ERR(cpts->ptp_clock));
1004-
if (!cpts->ptp_clock)
1005-
ret = -ENODEV;
1004+
ret = cpts->ptp_clock ? PTR_ERR(cpts->ptp_clock) : -ENODEV;
10061005
goto refclk_disable;
10071006
}
10081007
cpts->phc_index = ptp_clock_index(cpts->ptp_clock);

0 commit comments

Comments
 (0)