All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Nicolas Pitre <nico@fluxnic.net>
Cc: Richard Cochran <richardcochran@gmail.com>,
	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: Mon, 20 Mar 2023 15:20:30 +0200	[thread overview]
Message-ID: <ZBhdnl1OAPcrLdHD@smile.fi.intel.com> (raw)
In-Reply-To: <73rqs90r-nn9o-s981-9557-q70no2435176@syhkavp.arg>

On Wed, Mar 15, 2023 at 10:37:58AM -0400, Nicolas Pitre wrote:
> On Wed, 15 Mar 2023, Andy Shevchenko wrote:
> > On Tue, Mar 14, 2023 at 12:46:48PM -0700, Richard Cochran wrote:
> > > On Tue, Mar 14, 2023 at 12:47:03PM +0200, Andy Shevchenko wrote:
> > > > 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.
> > > 
> > > Does it now?  Whatever.
> > > 
> > > > TL;DR: If I'm mistaken, I would like to know why.
> > > 
> > > git log.  git blame.
> > > 
> > > Get to know the tools of trade.
> > 
> > So, the culprit seems the commit d1cbfd771ce8 ("ptp_clock: Allow for it
> > to be optional") which did it half way.
> > 
> > Now I would like to know why the good idea got bad implementation.
> > 
> > Nicolas?
> 
> I'd be happy to help but as presented I simply don't know what you're 
> talking about. Please give me more context.

When your change introduced the optionality of the above mentioned API,
i.e. ptp_clock_register(), the function started returning NULL, which
is fine. What's not in my opinion is to ask individual drivers to handle it.
That said, if we take a look at gpiod_*_optional() or clk_*_optional()
we may notice that they handle NULL as a valid parameter (object) to their
respective APIs and individual drivers shouldn't take care about that.

Why PTP is so special?

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2023-03-20 13:22 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
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 [this message]
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=ZBhdnl1OAPcrLdHD@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=nico@fluxnic.net \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.