Skip to contentSkip to conversation

modpost, tpm_tis: Remove wildcard ACPI and PNP aliases

PATCH New Ben Hutchings 1 participant 1 message Aug 13, 2013 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 modpost, tpm_tis: Remove wildcard ACPI and PNP aliases

tpm_tis has a 'spare' entry in its device ID table for adding user-specified device IDs. This will be ignored by the driver matching logic, but modpost turns it into:

alias:          acpi*::*
alias:          pnp:d*

This seems to result in the driver being loaded on almost all PCs. Change do_pnp_device_entry() to stop if it finds such an entry, similarly to do_usb_entry_multi().

---
 scripts/mod/file2alias.c | 8 ++++++++
 1 file changed, 8 insertions(+)
scripts/mod/file2alias.c +8 -0
index 2370863..7dc7edf 100644
@@ -535,6 +535,14 @@ static void do_pnp_device_entry(void *symval, unsigned long size,
 		char acpi_id[sizeof(*id)];
 		int j;
 
+		/*
+		 * Some modules (tpm_tis) have empty slots as
+		 * placeholder for run-time specification that results
+		 * in catch-all alias
+		 */
+		if (!**id)
+			return;
+
 		buf_printf(&mod->dev_table_buf,
 			   "MODULE_ALIAS(\"pnp:d%s*\");\n", *id);