From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Richard Cochran <richardcochran@gmail.com>
Cc: Tianfei Zhang <tianfei.zhang@intel.com>,
netdev@vger.kernel.org, linux-fpga@vger.kernel.org,
ilpo.jarvinen@linux.intel.com, russell.h.weight@intel.com,
matthew.gerlach@linux.intel.com,
pierre-louis.bossart@linux.intel.com, vinicius.gomes@intel.com,
Raghavendra Khadatare <raghavendrax.anand.khadatare@intel.com>
Subject: Re: [PATCH v1] ptp: add ToD device driver for Intel FPGA cards
Date: Tue, 14 Mar 2023 12:47:03 +0200 [thread overview]
Message-ID: <ZBBQpwGhXK/YYGCB@smile.fi.intel.com> (raw)
In-Reply-To: <ZA9wUe33pMkhMu0e@hoboy.vegasvil.org>
On Mon, Mar 13, 2023 at 11:49:53AM -0700, Richard Cochran wrote:
> On Sun, Mar 12, 2023 at 11:02:39PM -0400, Tianfei Zhang wrote:
...
> > + dt->ptp_clock = ptp_clock_register(&dt->ptp_clock_ops, dev);
> > + if (IS_ERR(dt->ptp_clock))
> > + return dev_err_probe(dt->dev, PTR_ERR(dt->ptp_clock),
> > + "Unable to register PTP clock\n");
>
> Need to handle NULL as well...
>
> /**
> * ptp_clock_register() - register a PTP hardware clock driver
> *
> * @info: Structure describing the new clock.
> * @parent: Pointer to the parent device of the new clock.
> *
> * Returns a valid pointer on success or PTR_ERR on failure. If PHC
> * support is missing at the configuration level, this function
> * returns NULL, and drivers are expected to gracefully handle that
> * case separately.
> */
I'm wondering why.
The semantics of the above is similar to gpiod_get_optional() and since NULL
is a valid return in such cases, the PTP has to handle this transparently to
the user. Otherwise it's badly designed API which has to be fixed.
TL;DR: If I'm mistaken, I would like to know why.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2023-03-14 10:50 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-13 3:02 [PATCH v1] ptp: add ToD device driver for Intel FPGA cards Tianfei Zhang
2023-03-13 17:50 ` Marco Pagani
2023-03-15 2:59 ` Zhang, Tianfei
2023-03-16 15:03 ` Zhang, Tianfei
2023-03-13 18:49 ` Richard Cochran
2023-03-14 7:16 ` Zhang, Tianfei
2023-03-14 20:01 ` Richard Cochran
2023-03-14 10:47 ` Andy Shevchenko [this message]
2023-03-14 19:46 ` Richard Cochran
2023-03-15 13:59 ` Andy Shevchenko
2023-03-15 14:37 ` Nicolas Pitre
2023-03-20 13:20 ` Andy Shevchenko
2023-03-20 13:43 ` Nicolas Pitre
2023-03-20 19:41 ` Richard Cochran
2023-03-20 20:53 ` Nicolas Pitre
2023-03-21 13:02 ` Andy Shevchenko
2023-03-21 14:28 ` Zhang, Tianfei
2023-03-21 14:40 ` Andy Shevchenko
2023-03-21 14:52 ` Zhang, Tianfei
2023-03-22 4:17 ` Richard Cochran
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZBBQpwGhXK/YYGCB@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=linux-fpga@vger.kernel.org \
--cc=matthew.gerlach@linux.intel.com \
--cc=netdev@vger.kernel.org \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=raghavendrax.anand.khadatare@intel.com \
--cc=richardcochran@gmail.com \
--cc=russell.h.weight@intel.com \
--cc=tianfei.zhang@intel.com \
--cc=vinicius.gomes@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).