On Fri, Nov 6, 2020 at 12:35 PM Grygorii Strashko
<grygorii.stras...@ti.com> 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_clock_register(&cpts->ptp_info, cpts->dev);
>
>
> >       if (IS_ERR_OR_NULL(cpts->ptp_clock)) {
>
> And ptp_clock_register() can return NULL only if PTP support is disabled.
> In which case, we should not even get here.
>
> So, I'd propose to s/IS_ERR_OR_NULL/IS_ERR above,
> and just assign ret = PTR_ERR(cpts->ptp_clock) here.

Right, using IS_ERR_OR_NULL() is almost ever a mistake, either
from misunderstanding the interface, or from a badly designed
interface that needs to be changed.

     Arnd

Reply via email to