public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Robin van der Gracht <robin@protonic.nl>
Cc: linux-kernel@vger.kernel.org, Geert Uytterhoeven <geert@linux-m68k.org>
Subject: Re: [PATCH v1 1/1] auxdisplay: ht16k33: Make use of i2c_get_match_data()
Date: Wed, 2 Oct 2024 17:02:57 +0300	[thread overview]
Message-ID: <Zv1SkQzXmpvZGjjd@smile.fi.intel.com> (raw)
In-Reply-To: <20241002140855.3cbf1076@erd007>

On Wed, Oct 02, 2024 at 02:08:55PM +0200, Robin van der Gracht wrote:
> On Mon, 30 Sep 2024 16:26:42 +0300
> Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:

...

> > 2) The above mentioned documentation says explicitly when user space
> > instantiation should be used. And for this driver it seems the only last
> > piece might be the case, i.e. prototyping / DIY configuration. For this
> > we don't need to rely on vendor ID anyway as in new supported hardware
> > the DT/ACPI emumeration is assumed.
> 
> Not sure what you mean here. It's statically declared in the device tree for
> the imx6dl-victgo board [1].

It's about documentation that listed 4 cases when the user may instantiate
the I²C target device via sysfs.

> > 3) Moreover, the currently used i2c_of_match_device() seems never be
> > considered to be used outside of i2c subsystem. Note, that it's being
> > used for device matching and probe, meaning firmware tables and board
> > info.
> 
> 4) It seems your change will also allows matching the device when it's
> enumerated through ACPI.

Yes.

> > Also note, that the other (yes, it's ONLY 2 drivers call this API)
> > user of that API is going to be updated as well. Taking 3) into account
> > I think soon we remove that API from bein exported to the modules.
> 
> i2c_of_match_device_sysfs() also matches the user input with the driver
> compatible string(s). Which is no longer true when i2c_get_match_data() is used.

Yes, and that's not needed. And again, the documentation does not mentioned
that compatible strings are allowed or have to be recognized by the driver
when the instantiation is done via sysfs.

> Not sure if it make sense to match against the compatible string at this point
> though. Because I'm not sure if the device can be instantiated through
> user space by using the compatible string in the first place. If so, there would
> only be 2 drives that can get their match data... 

Yes, strictly speaking it makes a little sense, esp. if the device needs some
(mandatory) device properties. In any case this change doesn't prevent user from
doing that, just without vendor prefix.

> The documentation doesn't mention the compatible string for user space
> instantiating just to use "the name of the I2C device".

Exactly!

> So maybe it's a good thing to remove that API or at least part of it.

We can't remove it, but we can hide it from being used outside of I²C core.
That's what I mentioned in 3) above.

> Regardless, the change looks good to me.
> 
> Reviewed-by: Robin van der Gracht <robin@protonic.nl>

Thank you for the review!

> 1: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/nxp/imx/imx6dl-victgo.dts?h=v6.12-rc1#n278

-- 
With Best Regards,
Andy Shevchenko



      reply	other threads:[~2024-10-02 14:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-30 13:26 [PATCH v1 1/1] auxdisplay: ht16k33: Make use of i2c_get_match_data() Andy Shevchenko
2024-10-02 12:08 ` Robin van der Gracht
2024-10-02 14:02   ` Andy Shevchenko [this message]

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=Zv1SkQzXmpvZGjjd@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robin@protonic.nl \
    /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