From: "Jon Smirl" <jonsmirl@gmail.com>
To: benh@kernel.crashing.org
Cc: Jean Delvare <khali@linux-fr.org>,
linuxppc-dev@ozlabs.org, i2c@lm-sensors.org
Subject: Re: [i2c] [PATCH 0/4] Series to add device tree naming to i2c
Date: Sun, 9 Dec 2007 16:35:05 -0500 [thread overview]
Message-ID: <9e4733910712091335g534d9248gcd920850f9f679a1@mail.gmail.com> (raw)
In-Reply-To: <1197234799.6563.19.camel@pasglop>
On 12/9/07, Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
>
> On Sun, 2007-12-09 at 15:57 -0500, Jon Smirl wrote:
> >
> > Are there technical concerns with this series? The white space can be
> > fixed in a few minutes.
> >
> > Adding a tag to differentiate matching types has implications that are
> > broader than just i2c. Shouldn't we do this first with the existing
> > scheme and then change the tagging process with later patches?
>
> No, we should decide on what to do with the tagging process (or not do)
> first, don't you think ? (If we need a tagging process, Scott had a
> concern but it might be moot, let's discuss that first).
Right now the tags are simply strings. The second parameter is driver specific.
+static struct i2c_device_id rs5c372_id[] = {
+ {"rtc-rs5c372", rtc_rs5c372a},
+ {"rs5c372a", rtc_rs5c372a},
+ {"rs5c372b", rtc_rs5c372b},
+ {"rv5c386", rtc_rv5c386},
+ {"rv5c387a", rtc_rv5c387a},
+ {"ricoh,rs5c372a", rtc_rs5c372a},
+ {"ricoh,rs5c372b", rtc_rs5c372b},
+ {"ricoh,rv5c386", rtc_rv5c386},
+ {"ricoh,rv5c387a", rtc_rv5c387a},
+ {},
+};
The current mechanism is simple string matching there are no platform
specific namespaces.
We could wrap the device tree style names in a macro that adds a
non-printable character to the front.
Something like this:
#define DT_NAMESPACE "\1"
#define DT_NAME(x) (DT_NAMESPACE x)
+ {DT_NAME("ricoh,rv5c386"), rtc_rv5c386},
And then modify the mpc i2c driver to insert the DT_NAMESPACE in front
of the string.
Another solution would be to make the names disappear on non-device
tree platforms
in mod_devicetable.h:
#ifdef USING_DEVICE_TREES
#define DT_NAME(x) x
#else
#define DTNAME(x)
#endif
+static struct i2c_device_id rs5c372_id[] = {
+ {"rtc-rs5c372", rtc_rs5c372a},
+ {"rs5c372a", rtc_rs5c372a},
+ {"rs5c372b", rtc_rs5c372b},
+ {"rv5c386", rtc_rv5c386},
+ {"rv5c387a", rtc_rv5c387a},
+ DT_NAME({"ricoh,rs5c372a", rtc_rs5c372a},)
+ DT_NAME({"ricoh,rs5c372b", rtc_rs5c372b},)
+ DT_NAME({"ricoh,rv5c386", rtc_rv5c386},)
+ DT_NAME({"ricoh,rv5c387a", rtc_rv5c387a},)
+ {},
But what's the point in making these names specific to device trees?
They are perfectly valid names for the devices that could be used from
any platform.
--
Jon Smirl
jonsmirl@gmail.com
next prev parent reply other threads:[~2007-12-09 21:35 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-03 21:20 [PATCH 0/4] Series to add device tree naming to i2c Jon Smirl
2007-12-03 21:20 ` [PATCH 1/4] Implement module aliasing for i2c to translate from device tree names Jon Smirl
2007-12-03 21:20 ` [PATCH 2/4] Modify several rtc drivers to use the alias names list property of i2c Jon Smirl
2007-12-03 21:20 ` [PATCH 3/4] Convert PowerPC MPC i2c to of_platform_driver from platform_driver Jon Smirl
2007-12-03 21:20 ` [PATCH 4/4] Convert pfc8563 i2c driver from old style to new style Jon Smirl
2007-12-03 23:37 ` [PATCH 0/4] Series to add device tree naming to i2c Olof Johansson
2007-12-03 23:51 ` Scott Wood
2007-12-03 23:52 ` Jon Smirl
2007-12-04 0:04 ` Olof Johansson
2007-12-09 20:24 ` [i2c] " Jon Smirl
2007-12-09 20:39 ` Olof Johansson
2007-12-09 20:46 ` Benjamin Herrenschmidt
2007-12-09 20:57 ` Jon Smirl
2007-12-09 21:13 ` Benjamin Herrenschmidt
2007-12-09 21:35 ` Jon Smirl [this message]
2007-12-09 21:38 ` Benjamin Herrenschmidt
2007-12-09 21:46 ` Jon Smirl
2007-12-09 21:53 ` Olof Johansson
2007-12-10 16:42 ` Scott Wood
2007-12-10 18:06 ` Jon Smirl
2007-12-10 18:37 ` Scott Wood
2007-12-10 18:52 ` Jon Smirl
2007-12-10 20:35 ` Benjamin Herrenschmidt
2007-12-10 20:32 ` Benjamin Herrenschmidt
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=9e4733910712091335g534d9248gcd920850f9f679a1@mail.gmail.com \
--to=jonsmirl@gmail.com \
--cc=benh@kernel.crashing.org \
--cc=i2c@lm-sensors.org \
--cc=khali@linux-fr.org \
--cc=linuxppc-dev@ozlabs.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).