aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/mod
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/mod')
-rw-r--r--scripts/mod/file2alias.c25
-rw-r--r--scripts/mod/modpost.c7
2 files changed, 32 insertions, 0 deletions
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index e26e2fb462d4..f936d1fa969d 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -735,6 +735,27 @@ static int do_virtio_entry(const char *filename, struct virtio_device_id *id,
735 return 1; 735 return 1;
736} 736}
737 737
738/*
739 * Looks like: vmbus:guid
740 * Each byte of the guid will be represented by two hex characters
741 * in the name.
742 */
743
744static int do_vmbus_entry(const char *filename, struct hv_vmbus_device_id *id,
745 char *alias)
746{
747 int i;
748 char guid_name[((sizeof(id->guid) + 1)) * 2];
749
750 for (i = 0; i < (sizeof(id->guid) * 2); i += 2)
751 sprintf(&guid_name[i], "%02x", id->guid[i/2]);
752
753 strcpy(alias, "vmbus:");
754 strcat(alias, guid_name);
755
756 return 1;
757}
758
738/* Looks like: i2c:S */ 759/* Looks like: i2c:S */
739static int do_i2c_entry(const char *filename, struct i2c_device_id *id, 760static int do_i2c_entry(const char *filename, struct i2c_device_id *id,
740 char *alias) 761 char *alias)
@@ -994,6 +1015,10 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
994 do_table(symval, sym->st_size, 1015 do_table(symval, sym->st_size,
995 sizeof(struct virtio_device_id), "virtio", 1016 sizeof(struct virtio_device_id), "virtio",
996 do_virtio_entry, mod); 1017 do_virtio_entry, mod);
1018 else if (sym_is(symname, "__mod_vmbus_device_table"))
1019 do_table(symval, sym->st_size,
1020 sizeof(struct hv_vmbus_device_id), "vmbus",
1021 do_vmbus_entry, mod);
997 else if (sym_is(symname, "__mod_i2c_device_table")) 1022 else if (sym_is(symname, "__mod_i2c_device_table"))
998 do_table(symval, sym->st_size, 1023 do_table(symval, sym->st_size,
999 sizeof(struct i2c_device_id), "i2c", 1024 sizeof(struct i2c_device_id), "i2c",
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index a509ff8f32fa..2bd594e6d1b4 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -1849,6 +1849,12 @@ static void add_header(struct buffer *b, struct module *mod)
1849 buf_printf(b, "};\n"); 1849 buf_printf(b, "};\n");
1850} 1850}
1851 1851
1852static void add_intree_flag(struct buffer *b, int is_intree)
1853{
1854 if (is_intree)
1855 buf_printf(b, "\nMODULE_INFO(intree, \"Y\");\n");
1856}
1857
1852static void add_staging_flag(struct buffer *b, const char *name) 1858static void add_staging_flag(struct buffer *b, const char *name)
1853{ 1859{
1854 static const char *staging_dir = "drivers/staging"; 1860 static const char *staging_dir = "drivers/staging";
@@ -2169,6 +2175,7 @@ int main(int argc, char **argv)
2169 buf.pos = 0; 2175 buf.pos = 0;
2170 2176
2171 add_header(&buf, mod); 2177 add_header(&buf, mod);
2178 add_intree_flag(&buf, !external_module);
2172 add_staging_flag(&buf, mod->name); 2179 add_staging_flag(&buf, mod->name);
2173 err |= add_versions(&buf, mod); 2180 err |= add_versions(&buf, mod);
2174 add_depends(&buf, mod, modules); 2181 add_depends(&buf, mod, modules);