From: Greg KH <greg@kroah.com>
To: Jean Delvare <khali@linux-fr.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
i2c@lm-sensors.org,
Linux Kernel Development <linux-kernel@vger.kernel.org>,
David Brownell <david-b@pacbell.net>
Subject: Re: [i2c] i2c module aliases
Date: Thu, 7 Jun 2007 09:02:14 -0700 [thread overview]
Message-ID: <20070607160214.GB17800@kroah.com> (raw)
In-Reply-To: <20070607175342.3006e872@hyperion.delvare>
On Thu, Jun 07, 2007 at 05:53:42PM +0200, Jean Delvare wrote:
> Hi Geert,
>
> On Wed, 6 Jun 2007 23:32:38 +0200 (CEST), Geert Uytterhoeven wrote:
> > >From browsing through file2alias.c, I have the impression there's a
> > missing TO_NATIVE() conversion in the handling of 16-bit (hence,
> > endian-affected) i2c IDs.
> > This will cause the module aliases to be incorrect when cross-compiling
> > for a system with a different endianness. Is that correct?
> > If yes, the patch below adds the missing conversion.
> >
> > Of course, no driver seems to use `MODULE_DEVICE_TABLE(i2c, ...)' yet,
> > hence nobody noticed.
> >
> > Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> >
> > --- a/scripts/mod/file2alias.c
> > +++ b/scripts/mod/file2alias.c
> > @@ -390,6 +390,7 @@ static int do_vio_entry(const char *file
> >
> > static int do_i2c_entry(const char *filename, struct i2c_device_id *i2c, char *alias)
> > {
> > + i2c->id = TO_NATIVE(i2c->id);
> > strcpy(alias, "i2c:");
> > ADD(alias, "id", 1, i2c->id);
> > return 1;
> >
>
> Looks correct. However I am curious what this "i2c->id" is supposed to
> represent, given that I2C devices do not have any form of ID as PCI or
> USB devices have. No driver uses "MODULE_DEVICE_TABLE(i2c, ...)"
> probably just because it doesn't make sense. So, rather than fixing
> this, shouldn't we simply wipe out struct i2c_device_id? Greg, David?
If no one is using it, then yes, it should be removed.
Sorry, I added it a while ago thinking it was going to be used (I had
test patches using it in my tree, but they never worked out in the end.)
thanks,
greg k-h
next prev parent reply other threads:[~2007-06-07 16:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-06 21:32 i2c module aliases Geert Uytterhoeven
2007-06-07 15:53 ` [i2c] " Jean Delvare
2007-06-07 16:02 ` Greg KH [this message]
2007-06-08 13:35 ` Jean Delvare
2007-06-08 14:48 ` Geert Uytterhoeven
2007-06-09 10:52 ` Jean Delvare
2007-06-14 19:14 ` Greg KH
2007-06-15 17:52 ` Jean Delvare
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=20070607160214.GB17800@kroah.com \
--to=greg@kroah.com \
--cc=david-b@pacbell.net \
--cc=geert@linux-m68k.org \
--cc=i2c@lm-sensors.org \
--cc=khali@linux-fr.org \
--cc=linux-kernel@vger.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