From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Wolfram Sang <wsa@kernel.org>
Cc: linux-i2c@vger.kernel.org, Jose Cazarin <joseespiriki@gmail.com>
Subject: Re: Device match data and DT compatible string fallback
Date: Mon, 28 Jun 2021 19:21:56 +0300 [thread overview]
Message-ID: <YNn3JPC9Fx5xRMN7@pendragon.ideasonboard.com> (raw)
In-Reply-To: <YNnw1aqUk/zVkz4j@ninjato>
Hi Wolfram,
On Mon, Jun 28, 2021 at 05:55:01PM +0200, Wolfram Sang wrote:
>
> > I could fix this in the driver by calling of_device_get_match_data() in
> > the probe function with dev->of_node is not NULL, but I feel this is
> > really an issue that should be handled by the framework. Has anyone ever
> > given it a thought ?
>
> The of entries should also have .data entries and use that.
That doesn't help unfortunately, as the i2c_device_id passed to probe()
comes from the i2c_device_id table, the of_device_id table isn't
involved.
> The driver could also be converted to probe_new to become independent of
> the i2c_device_id.
Sure, but that doesn't solve the problem, it only forces the driver to
basically implement
if (dev->of_node)
get data using of_device_get_match_data();
else
get data using i2c_match_id();
Shouldn't the I2C subsystem provide a single function to let the driver
retrieve the match data, regardless of where it comes from ?
--
Regards,
Laurent Pinchart
prev parent reply other threads:[~2021-06-28 16:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-28 15:29 Device match data and DT compatible string fallback Laurent Pinchart
2021-06-28 15:55 ` Wolfram Sang
2021-06-28 16:21 ` Laurent Pinchart [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=YNn3JPC9Fx5xRMN7@pendragon.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=joseespiriki@gmail.com \
--cc=linux-i2c@vger.kernel.org \
--cc=wsa@kernel.org \
/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).