Skip to content

Commit

Permalink
pnp: fix "add acpi:* modalias entries"
Browse files Browse the repository at this point in the history
With 22454cb we added only the
first entry of the device table. We need to loop over the whole
device list.

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Kay Sievers authored and Greg Kroah-Hartman committed Aug 21, 2008
1 parent c767db0 commit 5e4c656
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions scripts/mod/file2alias.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 5e4c656

Please sign in to comment.