diff options
author | Adam Belay <ambx1@neo.rr.com> | 2004-02-08 15:40:52 +0000 |
---|---|---|
committer | Adam Belay <ambx1@neo.rr.com> | 2004-02-08 15:40:52 +0000 |
commit | 9afb885b334e7029507267132419658c65da94b3 (patch) | |
tree | c7e6a952ccc4f109467a0d5dbb33e6ac99136c34 /scripts | |
parent | 3f0f5c1cc3474d7c13adba438fd313123c8176dc (diff) | |
download | history-9afb885b334e7029507267132419658c65da94b3.tar.gz |
[PNP]: file2alias support
This patch updates file2alias.c to support pnp ids. It is from
Takashi Iwai <tiwai@suse.de>.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/file2alias.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/scripts/file2alias.c b/scripts/file2alias.c index 8c707215b8344..ee86c9833528e 100644 --- a/scripts/file2alias.c +++ b/scripts/file2alias.c @@ -169,6 +169,29 @@ static int do_ccw_entry(const char *filename, return 1; } +/* looks like: "pnp:dD" */ +static int do_pnp_entry(const char *filename, + struct pnp_device_id *id, char *alias) +{ + sprintf(alias, "pnp:d%s", id->id); + return 1; +} + +/* looks like: "pnp:cCdD..." */ +static int do_pnp_card_entry(const char *filename, + struct pnp_card_device_id *id, char *alias) +{ + int i; + + sprintf(alias, "pnp:c%s", id->id); + for (i = 0; i < PNP_MAX_DEVICES; i++) { + if (! *id->devs[i].id) + break; + sprintf(alias + strlen(alias), "d%s", id->devs[i].id); + } + return 1; +} + /* Ignore any prefix, eg. v850 prepends _ */ static inline int sym_is(const char *symbol, const char *name) { @@ -235,6 +258,12 @@ void handle_moddevtable(struct module *mod, struct elf_info *info, else if (sym_is(symname, "__mod_ccw_device_table")) do_table(symval, sym->st_size, sizeof(struct ccw_device_id), do_ccw_entry, mod); + else if (sym_is(symname, "__mod_pnp_device_table")) + do_table(symval, sym->st_size, sizeof(struct pnp_device_id), + do_pnp_entry, mod); + else if (sym_is(symname, "__mod_pnp_card_device_table")) + do_table(symval, sym->st_size, sizeof(struct pnp_card_device_id), + do_pnp_card_entry, mod); } /* Now add out buffered information to the generated C source */ |