diff options
Diffstat (limited to 'scripts/mod/file2alias.c')
-rw-r--r-- | scripts/mod/file2alias.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index d8ee38aede26..e3d144a3f10b 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c | |||
@@ -295,11 +295,13 @@ static int do_pcmcia_entry(const char *filename, | |||
295 | { | 295 | { |
296 | unsigned int i; | 296 | unsigned int i; |
297 | 297 | ||
298 | id->match_flags = TO_NATIVE(id->match_flags); | ||
298 | id->manf_id = TO_NATIVE(id->manf_id); | 299 | id->manf_id = TO_NATIVE(id->manf_id); |
299 | id->card_id = TO_NATIVE(id->card_id); | 300 | id->card_id = TO_NATIVE(id->card_id); |
300 | id->func_id = TO_NATIVE(id->func_id); | 301 | id->func_id = TO_NATIVE(id->func_id); |
301 | id->function = TO_NATIVE(id->function); | 302 | id->function = TO_NATIVE(id->function); |
302 | id->device_no = TO_NATIVE(id->device_no); | 303 | id->device_no = TO_NATIVE(id->device_no); |
304 | |||
303 | for (i=0; i<4; i++) { | 305 | for (i=0; i<4; i++) { |
304 | id->prod_id_hash[i] = TO_NATIVE(id->prod_id_hash[i]); | 306 | id->prod_id_hash[i] = TO_NATIVE(id->prod_id_hash[i]); |
305 | } | 307 | } |
@@ -357,6 +359,13 @@ static int do_vio_entry(const char *filename, struct vio_device_id *vio, | |||
357 | return 1; | 359 | return 1; |
358 | } | 360 | } |
359 | 361 | ||
362 | static int do_i2c_entry(const char *filename, struct i2c_device_id *i2c, char *alias) | ||
363 | { | ||
364 | strcpy(alias, "i2c:"); | ||
365 | ADD(alias, "id", 1, i2c->id); | ||
366 | return 1; | ||
367 | } | ||
368 | |||
360 | /* Ignore any prefix, eg. v850 prepends _ */ | 369 | /* Ignore any prefix, eg. v850 prepends _ */ |
361 | static inline int sym_is(const char *symbol, const char *name) | 370 | static inline int sym_is(const char *symbol, const char *name) |
362 | { | 371 | { |
@@ -441,6 +450,9 @@ void handle_moddevtable(struct module *mod, struct elf_info *info, | |||
441 | else if (sym_is(symname, "__mod_vio_device_table")) | 450 | else if (sym_is(symname, "__mod_vio_device_table")) |
442 | do_table(symval, sym->st_size, sizeof(struct vio_device_id), | 451 | do_table(symval, sym->st_size, sizeof(struct vio_device_id), |
443 | do_vio_entry, mod); | 452 | do_vio_entry, mod); |
453 | else if (sym_is(symname, "__mod_i2c_device_table")) | ||
454 | do_table(symval, sym->st_size, sizeof(struct i2c_device_id), | ||
455 | do_i2c_entry, mod); | ||
444 | 456 | ||
445 | } | 457 | } |
446 | 458 | ||