Re: [PATCH] net/ethernet: update ret when ptp_clock is ERROR

2020-11-11 Thread Grygorii Strashko
On 07/11/2020 17:08, Richard Cochran wrote: On Fri, Nov 06, 2020 at 03:56:45PM +0800, Wang Qing wrote: We always have to update the value of ret, otherwise the error value may be the previous one. Signed-off-by: Wang Qing Acked-by: Richard Cochran Following Richard's comments: Revi

Re: [V2] [PATCH] net/ethernet: update ret when ptp_clock is ERROR

2020-11-07 Thread Jakub Kicinski
On Sat, 7 Nov 2020 06:58:16 -0800 Richard Cochran wrote: > On Sat, Nov 07, 2020 at 11:38:38AM +0800, Wang Qing wrote: > > 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, so

Re: [PATCH] net/ethernet: update ret when ptp_clock is ERROR

2020-11-07 Thread Richard Cochran
On Fri, Nov 06, 2020 at 03:56:45PM +0800, Wang Qing wrote: > We always have to update the value of ret, otherwise the > error value may be the previous one. > > Signed-off-by: Wang Qing Acked-by: Richard Cochran > --- > drivers/net/ethernet/ti/am65-cpts.c | 3 +-- > 1 file changed, 1 insert

Re: [PATCH] net/ethernet: update ret when ptp_clock is ERROR

2020-11-07 Thread Richard Cochran
On Fri, Nov 06, 2020 at 01:34:04PM +0200, Grygorii Strashko wrote: > And ptp_clock_register() can return NULL only if PTP support is disabled. Not true in general ... > In which case, we should not even get here. only because the Kconfig uses "depends on" instead of "implies" PTP_1588_CLOCK. >

Re: [V2] [PATCH] net/ethernet: update ret when ptp_clock is ERROR

2020-11-07 Thread Richard Cochran
On Sat, Nov 07, 2020 at 11:38:38AM +0800, Wang Qing wrote: > 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, so we use IS_ERR here. > > Signed-off-by: Wang Qing > --- > driv

[V2] [PATCH] net/ethernet: update ret when ptp_clock is ERROR

2020-11-06 Thread Wang Qing
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, so we use IS_ERR here. Signed-off-by: Wang Qing --- drivers/net/ethernet/ti/am65-cpts.c | 5 ++--- 1 file changed, 2 insertions(+

Re: [PATCH] net/ethernet: update ret when ptp_clock is ERROR

2020-11-06 Thread Grygorii Strashko
On 06/11/2020 14:58, Kurt Kanzenbach wrote: On Fri Nov 06 2020, Arnd Bergmann wrote: On Fri, Nov 6, 2020 at 12:35 PM Grygorii Strashko wrote: On 06/11/2020 09:56, Wang Qing wrote: +++ b/drivers/net/ethernet/ti/am65-cpts.c @@ -1001,8 +1001,7 @@ struct am65_cpts *am65_cpts_create(struct de

Re: [PATCH] net/ethernet: update ret when ptp_clock is ERROR

2020-11-06 Thread Kurt Kanzenbach
On Fri Nov 06 2020, Arnd Bergmann wrote: > On Fri, Nov 6, 2020 at 12:35 PM Grygorii Strashko > wrote: >> On 06/11/2020 09:56, Wang Qing wrote: > >> > +++ b/drivers/net/ethernet/ti/am65-cpts.c >> > @@ -1001,8 +1001,7 @@ struct am65_cpts *am65_cpts_create(struct device >> > *dev, void __iomem *regs

Re: [PATCH] net/ethernet: update ret when ptp_clock is ERROR

2020-11-06 Thread Arnd Bergmann
On Fri, Nov 6, 2020 at 12:35 PM Grygorii Strashko wrote: > On 06/11/2020 09:56, Wang Qing wrote: > > +++ b/drivers/net/ethernet/ti/am65-cpts.c > > @@ -1001,8 +1001,7 @@ struct am65_cpts *am65_cpts_create(struct device > > *dev, void __iomem *regs, > > there is > cpts->ptp_clock = ptp_clo

Re: [PATCH] net/ethernet: update ret when ptp_clock is ERROR

2020-11-06 Thread Grygorii Strashko
On 06/11/2020 09:56, Wang Qing wrote: We always have to update the value of ret, otherwise the error value may be the previous one. Signed-off-by: Wang Qing --- drivers/net/ethernet/ti/am65-cpts.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet

[PATCH] net/ethernet: update ret when ptp_clock is ERROR

2020-11-05 Thread Wang Qing
We always have to update the value of ret, otherwise the error value may be the previous one. Signed-off-by: Wang Qing --- 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/am6