aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/mod
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/mod')
-rw-r--r--scripts/mod/file2alias.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 808c20d81f8d..5758aab0d8bb 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -796,6 +796,28 @@ static int do_platform_entry(const char *filename,
796 return 1; 796 return 1;
797} 797}
798 798
799static int do_mdio_entry(const char *filename,
800 struct mdio_device_id *id, char *alias)
801{
802 int i;
803
804 alias += sprintf(alias, MDIO_MODULE_PREFIX);
805
806 for (i = 0; i < 32; i++) {
807 if (!((id->phy_id_mask >> (31-i)) & 1))
808 *(alias++) = '?';
809 else if ((id->phy_id >> (31-i)) & 1)
810 *(alias++) = '1';
811 else
812 *(alias++) = '0';
813 }
814
815 /* Terminate the string */
816 *alias = 0;
817
818 return 1;
819}
820
799/* Looks like: zorro:iN. */ 821/* Looks like: zorro:iN. */
800static int do_zorro_entry(const char *filename, struct zorro_device_id *id, 822static int do_zorro_entry(const char *filename, struct zorro_device_id *id,
801 char *alias) 823 char *alias)
@@ -966,6 +988,10 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
966 do_table(symval, sym->st_size, 988 do_table(symval, sym->st_size,
967 sizeof(struct platform_device_id), "platform", 989 sizeof(struct platform_device_id), "platform",
968 do_platform_entry, mod); 990 do_platform_entry, mod);
991 else if (sym_is(symname, "__mod_mdio_device_table"))
992 do_table(symval, sym->st_size,
993 sizeof(struct mdio_device_id), "mdio",
994 do_mdio_entry, mod);
969 else if (sym_is(symname, "__mod_zorro_device_table")) 995 else if (sym_is(symname, "__mod_zorro_device_table"))
970 do_table(symval, sym->st_size, 996 do_table(symval, sym->st_size,
971 sizeof(struct zorro_device_id), "zorro", 997 sizeof(struct zorro_device_id), "zorro",