aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/mod/file2alias.c
diff options
context:
space:
mode:
authorThomas Renninger <trenn@suse.de>2007-07-23 08:43:51 -0400
committerLen Brown <len.brown@intel.com>2007-07-23 13:56:16 -0400
commit29b71a1ca74491fab9fed09e9d835d840d042690 (patch)
treee46dc9c53e4b6266703dedc21925875cea9e4abc /scripts/mod/file2alias.c
parent8c8eb78f673c07b60f31751e1e47ac367c60c6b7 (diff)
ACPI: autoload modules - Create ACPI alias interface
Modify modpost (file2alias.c) to add acpi*:XYZ0001: alias in modules.alias like: grep acpi /lib/modules/2.6.22-rc4-default/modules.alias alias acpi*:SNY5001:* sony_laptop alias acpi*:SNY6001:* sony_laptop for e.g. the sony_laptop module. This module matches against all ACPI devices with a HID or CID of SNY5001 or SNY6001 Export an uevent and modalias sysfs file containing the string: [MODALIAS=]acpi:PNP0C0C: additional CIDs are concatenated at the end. Signed-off-by: Thomas Renninger <trenn@suse.de> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'scripts/mod/file2alias.c')
-rw-r--r--scripts/mod/file2alias.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index f646381dc015..8a09021d8c59 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -290,6 +290,14 @@ static int do_serio_entry(const char *filename,
290 return 1; 290 return 1;
291} 291}
292 292
293/* looks like: "acpi:ACPI0003 or acpi:PNP0C0B" or "acpi:LNXVIDEO" */
294static int do_acpi_entry(const char *filename,
295 struct acpi_device_id *id, char *alias)
296{
297 sprintf(alias, "acpi*:%s:", id->id);
298 return 1;
299}
300
293/* looks like: "pnp:dD" */ 301/* looks like: "pnp:dD" */
294static int do_pnp_entry(const char *filename, 302static int do_pnp_entry(const char *filename,
295 struct pnp_device_id *id, char *alias) 303 struct pnp_device_id *id, char *alias)
@@ -551,6 +559,10 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
551 do_table(symval, sym->st_size, 559 do_table(symval, sym->st_size,
552 sizeof(struct serio_device_id), "serio", 560 sizeof(struct serio_device_id), "serio",
553 do_serio_entry, mod); 561 do_serio_entry, mod);
562 else if (sym_is(symname, "__mod_acpi_device_table"))
563 do_table(symval, sym->st_size,
564 sizeof(struct acpi_device_id), "acpi",
565 do_acpi_entry, mod);
554 else if (sym_is(symname, "__mod_pnp_device_table")) 566 else if (sym_is(symname, "__mod_pnp_device_table"))
555 do_table(symval, sym->st_size, 567 do_table(symval, sym->st_size,
556 sizeof(struct pnp_device_id), "pnp", 568 sizeof(struct pnp_device_id), "pnp",