From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Stephen Kitt <steve@sk2.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>,
Dianlong Li <long17.cool@163.com>, Wolfram Sang <wsa@kernel.org>,
linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rtc: use simple i2c probe
Date: Fri, 24 Jun 2022 19:42:49 +0200 [thread overview]
Message-ID: <YrX3mWxDex7OuEpn@mail.local> (raw)
In-Reply-To: <2bd6ab78f649ba282c5369d0e969fea2@sk2.org>
On 12/06/2022 21:23:47+0200, Stephen Kitt wrote:
> Hi Alexandre,
>
> Le 11/06/2022 16:48, Alexandre Belloni a écrit :
> > On 10/06/2022 18:23:43+0200, Stephen Kitt wrote:
> > > All these drivers have an i2c probe function which doesn't use the
> > > "struct i2c_device_id *id" parameter, so they can trivially be
> > > converted to the "probe_new" style of probe with a single argument.
> > >
> >
> > I think you should explain why you want to do that as the trend is to do
> > the exact opposite to allow support for those RTCS on x86 systems.
>
> Indeed, I should have given more context. The idea is to continue the
> transition started with https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b8a1a4cd5a98a2adf8dfd6902cd98e57d910ee12
> (in 2016...). I²C drivers using probe() involve a call to i2c_match_id: in
> drivers/i2c/i2c-core-base.c,
>
> /*
> * When there are no more users of probe(),
> * rename probe_new to probe.
> */
> if (driver->probe_new)
> status = driver->probe_new(client);
> else if (driver->probe)
> status = driver->probe(client,
> i2c_match_id(driver->id_table,
> client));
> else
> status = -EINVAL;
>
> Many drivers don't actually need the second parameter, so instead of having
> probe() with both parameters, the goal is to switch to a probe function with
> only "struct i2c_client *". Probe functions that *do* need the "struct
> i2c_device_id" can call i2c_match_id themselves (as is done currently with
> of_match_id).
>
> I discussed this briefly with Wolfram beginning of June at Kernel Recipes,
> and as I understood it the plan was still to continue with this transition
> (in fact, the plan was for *me* to continue with this transition).
>
> Do you have an example of a change requiring id to support RTCs on x86
> systems?
I checked and your patch is actually fine, the issue I referred to is:
1c1b3098ae1e ("rtc: pcf85063: add i2c_device_id name matching support")
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2022-06-24 17:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-10 16:23 [PATCH] rtc: use simple i2c probe Stephen Kitt
2022-06-11 14:48 ` Alexandre Belloni
2022-06-12 19:23 ` Stephen Kitt
2022-06-24 17:42 ` Alexandre Belloni [this message]
2022-06-24 21:05 ` Stephen Kitt
2022-06-24 17:40 ` Alexandre Belloni
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=YrX3mWxDex7OuEpn@mail.local \
--to=alexandre.belloni@bootlin.com \
--cc=a.zummo@towertech.it \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=long17.cool@163.com \
--cc=steve@sk2.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).