summaryrefslogtreecommitdiffstats
path: root/scripts/mod/file2alias.c
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/mod/file2alias.c')
-rw-r--r--scripts/mod/file2alias.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 4e4f03a12cc0..6dedc31a4925 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -1291,6 +1291,27 @@ static int do_typec_entry(const char *filename, void *symval, char *alias)
1291 return 1; 1291 return 1;
1292} 1292}
1293 1293
1294/* Looks like: wmi:guid */
1295static int do_wmi_entry(const char *filename, void *symval, char *alias)
1296{
1297 int len;
1298 DEF_FIELD_ADDR(symval, wmi_device_id, guid_string);
1299
1300 if (strlen(*guid_string) != UUID_STRING_LEN) {
1301 warn("Invalid WMI device id 'wmi:%s' in '%s'\n",
1302 *guid_string, filename);
1303 return 0;
1304 }
1305
1306 len = snprintf(alias, ALIAS_SIZE, WMI_MODULE_PREFIX "%s", *guid_string);
1307 if (len < 0 || len >= ALIAS_SIZE) {
1308 warn("Could not generate all MODULE_ALIAS's in '%s'\n",
1309 filename);
1310 return 0;
1311 }
1312 return 1;
1313}
1314
1294/* Does namelen bytes of name exactly match the symbol? */ 1315/* Does namelen bytes of name exactly match the symbol? */
1295static bool sym_is(const char *name, unsigned namelen, const char *symbol) 1316static bool sym_is(const char *name, unsigned namelen, const char *symbol)
1296{ 1317{
@@ -1361,6 +1382,7 @@ static const struct devtable devtable[] = {
1361 {"fslmc", SIZE_fsl_mc_device_id, do_fsl_mc_entry}, 1382 {"fslmc", SIZE_fsl_mc_device_id, do_fsl_mc_entry},
1362 {"tbsvc", SIZE_tb_service_id, do_tbsvc_entry}, 1383 {"tbsvc", SIZE_tb_service_id, do_tbsvc_entry},
1363 {"typec", SIZE_typec_device_id, do_typec_entry}, 1384 {"typec", SIZE_typec_device_id, do_typec_entry},
1385 {"wmi", SIZE_wmi_device_id, do_wmi_entry},
1364}; 1386};
1365 1387
1366/* Create MODULE_ALIAS() statements. 1388/* Create MODULE_ALIAS() statements.