Skip to content

Commit

Permalink
PNP: fix broken pnp lowercasing for acpi module aliases
Browse files Browse the repository at this point in the history
Based on a patch from Brian, who identified the issue.

Signed-off-by: Bryan Kadzban <bryan@kadzban.is-a-geek.net>
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 Jan 21, 2009
1 parent 7143f7a commit 72638f5
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions scripts/mod/file2alias.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,11 +366,17 @@ static void do_pnp_device_entry(void *symval, unsigned long size,

for (i = 0; i < count; i++) {
const char *id = (char *)devs[i].id;
char acpi_id[sizeof(devs[0].id)];
int j;

buf_printf(&mod->dev_table_buf,
"MODULE_ALIAS(\"pnp:d%s*\");\n", id);

/* fix broken pnp bus lowercasing */
for (j = 0; j < sizeof(acpi_id); j++)
acpi_id[j] = toupper(id[j]);
buf_printf(&mod->dev_table_buf,
"MODULE_ALIAS(\"acpi*:%s:*\");\n", id);
"MODULE_ALIAS(\"acpi*:%s:*\");\n", acpi_id);
}
}

Expand Down Expand Up @@ -416,10 +422,17 @@ static void do_pnp_card_entries(void *symval, unsigned long size,

/* add an individual alias for every device entry */
if (!dup) {
char acpi_id[sizeof(card->devs[0].id)];
int k;

buf_printf(&mod->dev_table_buf,
"MODULE_ALIAS(\"pnp:d%s*\");\n", id);

/* fix broken pnp bus lowercasing */
for (k = 0; k < sizeof(acpi_id); k++)
acpi_id[k] = toupper(id[k]);
buf_printf(&mod->dev_table_buf,
"MODULE_ALIAS(\"acpi*:%s:*\");\n", id);
"MODULE_ALIAS(\"acpi*:%s:*\");\n", acpi_id);
}
}
}
Expand Down

0 comments on commit 72638f5

Please sign in to comment.