summaryrefslogtreecommitdiffstats
path: root/scripts/mod/file2alias.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-08-25 14:39:12 +0200
committerIngo Molnar <mingo@elte.hu>2008-08-25 14:39:12 +0200
commitf58899bb0224741eb0409ada67ecafe90ba137ef (patch)
tree78284f77021e830b32e77071dd2ef4e5ccdaa289 /scripts/mod/file2alias.c
parenta2bd7274b47124d2fc4dfdb8c0591f545ba749dd (diff)
parent83097aca8567a0bd593534853b71fe0fa9a75d69 (diff)
Merge branch 'linus' into x86/urgent
Diffstat (limited to 'scripts/mod/file2alias.c')
-rw-r--r--scripts/mod/file2alias.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 4fa1f3ad251..4c9890ec252 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -344,14 +344,20 @@ static void do_pnp_device_entry(void *symval, unsigned long size,
struct module *mod)
{
const unsigned long id_size = sizeof(struct pnp_device_id);
- const struct pnp_device_id *id = symval;
+ const unsigned int count = (size / id_size)-1;
+ const struct pnp_device_id *devs = symval;
+ unsigned int i;
device_id_check(mod->name, "pnp", size, id_size, symval);
- buf_printf(&mod->dev_table_buf,
- "MODULE_ALIAS(\"pnp:d%s*\");\n", id->id);
- buf_printf(&mod->dev_table_buf,
- "MODULE_ALIAS(\"acpi*:%s:*\");\n", id->id);
+ for (i = 0; i < count; i++) {
+ const char *id = (char *)devs[i].id;
+
+ buf_printf(&mod->dev_table_buf,
+ "MODULE_ALIAS(\"pnp:d%s*\");\n", id);
+ buf_printf(&mod->dev_table_buf,
+ "MODULE_ALIAS(\"acpi*:%s:*\");\n", id);
+ }
}
/* looks like: "pnp:dD" for every device of the card */