summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2008-08-21 15:28:56 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2008-08-21 10:15:39 -0700
commit5e4c6564c95ce127beeefe75e15cd11c93487436 (patch)
tree4f76a9bb0402eb7c057dd80aa8393e2d3dc3d021
parentc767db0ab4bc85f06119f2b42369e31b29991f16 (diff)
downloadop-kernel-dev-5e4c6564c95ce127beeefe75e15cd11c93487436.zip
op-kernel-dev-5e4c6564c95ce127beeefe75e15cd11c93487436.tar.gz
pnp: fix "add acpi:* modalias entries"
With 22454cb99fc39f2629ad06a7eccb3df312f8830e 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>
-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 4fa1f3a..4c9890e 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 */
OpenPOWER on IntegriCloud