linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* i2c module aliases
@ 2007-06-06 21:32 Geert Uytterhoeven
  2007-06-07 15:53 ` [i2c] " Jean Delvare
  0 siblings, 1 reply; 8+ messages in thread
From: Geert Uytterhoeven @ 2007-06-06 21:32 UTC (permalink / raw)
  To: i2c; +Cc: Linux Kernel Development

>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;

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2007-06-15 17:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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).