diff options
Diffstat (limited to 'scripts/mod')
-rw-r--r-- | scripts/mod/file2alias.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index 769b69db89c1..e04c4218cb52 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c | |||
@@ -576,6 +576,15 @@ static int do_virtio_entry(const char *filename, struct virtio_device_id *id, | |||
576 | return 1; | 576 | return 1; |
577 | } | 577 | } |
578 | 578 | ||
579 | /* Looks like: i2c:S */ | ||
580 | static int do_i2c_entry(const char *filename, struct i2c_device_id *id, | ||
581 | char *alias) | ||
582 | { | ||
583 | sprintf(alias, I2C_MODULE_PREFIX "%s", id->name); | ||
584 | |||
585 | return 1; | ||
586 | } | ||
587 | |||
579 | /* Ignore any prefix, eg. v850 prepends _ */ | 588 | /* Ignore any prefix, eg. v850 prepends _ */ |
580 | static inline int sym_is(const char *symbol, const char *name) | 589 | static inline int sym_is(const char *symbol, const char *name) |
581 | { | 590 | { |
@@ -704,6 +713,10 @@ void handle_moddevtable(struct module *mod, struct elf_info *info, | |||
704 | do_table(symval, sym->st_size, | 713 | do_table(symval, sym->st_size, |
705 | sizeof(struct virtio_device_id), "virtio", | 714 | sizeof(struct virtio_device_id), "virtio", |
706 | do_virtio_entry, mod); | 715 | do_virtio_entry, mod); |
716 | else if (sym_is(symname, "__mod_i2c_device_table")) | ||
717 | do_table(symval, sym->st_size, | ||
718 | sizeof(struct i2c_device_id), "i2c", | ||
719 | do_i2c_entry, mod); | ||
707 | free(zeros); | 720 | free(zeros); |
708 | } | 721 | } |
709 | 722 | ||