[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACKFLin=v1kMLhPYP5Z=sdR6BW++ZeOh=5C=wzmqbUVpAmcLYg@mail.gmail.com>
Date: Fri, 28 May 2021 22:06:07 -0700
From: Michael Chan <michael.chan@...adcom.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: David Miller <davem@...emloft.net>,
Netdev <netdev@...r.kernel.org>,
Andrew Gospodarek <gospo@...adcom.com>,
richardcochran@...il.com, Pavan Chebbi <pavan.chebbi@...adcom.com>,
Edwin Peer <edwin.peer@...adcom.com>
Subject: Re: [PATCH net-next 3/7] bnxt_en: Add PTP clock APIs, ioctls, and
ethtool methods.
On Fri, May 28, 2021 at 6:42 PM Jakub Kicinski <kuba@...nel.org> wrote:
>
> On Fri, 28 May 2021 20:53:17 -0400 Michael Chan wrote:
> > +int bnxt_ptp_init(struct bnxt *bp)
>
> This function never fails.
>
> > + struct bnxt_ptp_cfg *ptp = bp->ptp_cfg;
> > +
> > + if (!ptp)
> > + return 0;
> > +
> > + atomic_set(&ptp->tx_avail, BNXT_MAX_TX_TS);
> > +
> > + memset(&ptp->cc, 0, sizeof(ptp->cc));
> > + ptp->cc.read = bnxt_cc_read;
> > + ptp->cc.mask = CYCLECOUNTER_MASK(64);
> > + ptp->cc.shift = 0;
> > + ptp->cc.mult = 1;
> > +
> > + timecounter_init(&ptp->tc, &ptp->cc, ktime_to_ns(ktime_get_real()));
> > +
> > + ptp->ptp_info = bnxt_ptp_caps;
> > + ptp->ptp_clock = ptp_clock_register(&ptp->ptp_info, &bp->pdev->dev);
> > + if (IS_ERR(ptp->ptp_clock))
> > + ptp->ptp_clock = NULL;
>
> Why not propagate the error? I thought only NULL should be silently
> ignored? I could be confused about the rules, tho :)
Yeah, we should propagate the error so the caller can print a warning.
>
> > + return 0;
Download attachment "smime.p7s" of type "application/pkcs7-signature" (4209 bytes)
Powered by blists - more mailing lists