From: Jean Delvare <khali@linux-fr.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: i2c@lm-sensors.org,
Linux Kernel Development <linux-kernel@vger.kernel.org>,
Greg KH <greg@kroah.com>, David Brownell <david-b@pacbell.net>
Subject: Re: [i2c] i2c module aliases
Date: Thu, 7 Jun 2007 17:53:42 +0200 [thread overview]
Message-ID: <20070607175342.3006e872@hyperion.delvare> (raw)
In-Reply-To: <Pine.LNX.4.64.0706062325270.30244@anakin>
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?
--
Jean Delvare
next prev parent reply other threads:[~2007-06-07 15:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-06 21:32 Geert Uytterhoeven
2007-06-07 15:53 ` Jean Delvare [this message]
2007-06-07 16:02 ` [i2c] " Greg KH
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=20070607175342.3006e872@hyperion.delvare \
--to=khali@linux-fr.org \
--cc=david-b@pacbell.net \
--cc=geert@linux-m68k.org \
--cc=greg@kroah.com \
--cc=i2c@lm-sensors.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
all inboxes | Powered by JetHome®