aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/mod/file2alias.c
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/mod/file2alias.c')
-rw-r--r--scripts/mod/file2alias.c276
1 files changed, 159 insertions, 117 deletions
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index f936d1fa969d..e8c969577768 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -28,6 +28,7 @@ typedef Elf64_Addr kernel_ulong_t;
28#endif 28#endif
29 29
30#include <ctype.h> 30#include <ctype.h>
31#include <stdbool.h>
31 32
32typedef uint32_t __u32; 33typedef uint32_t __u32;
33typedef uint16_t __u16; 34typedef uint16_t __u16;
@@ -38,6 +39,35 @@ typedef unsigned char __u8;
38 * we handle those differences explicitly below */ 39 * we handle those differences explicitly below */
39#include "../../include/linux/mod_devicetable.h" 40#include "../../include/linux/mod_devicetable.h"
40 41
42/* This array collects all instances that use the generic do_table */
43struct devtable {
44 const char *device_id; /* name of table, __mod_<name>_device_table. */
45 unsigned long id_size;
46 void *function;
47};
48
49/* We construct a table of pointers in an ELF section (pointers generally
50 * go unpadded by gcc). ld creates boundary syms for us. */
51extern struct devtable *__start___devtable[], *__stop___devtable[];
52#define ___cat(a,b) a ## b
53#define __cat(a,b) ___cat(a,b)
54
55#if __GNUC__ == 3 && __GNUC_MINOR__ < 3
56# define __used __attribute__((__unused__))
57#else
58# define __used __attribute__((__used__))
59#endif
60
61/* Add a table entry. We test function type matches while we're here. */
62#define ADD_TO_DEVTABLE(device_id, type, function) \
63 static struct devtable __cat(devtable,__LINE__) = { \
64 device_id + 0*sizeof((function)((const char *)NULL, \
65 (type *)NULL, \
66 (char *)NULL)), \
67 sizeof(type), (function) }; \
68 static struct devtable *__attribute__((section("__devtable"))) \
69 __used __cat(devtable_ptr,__LINE__) = &__cat(devtable,__LINE__)
70
41#define ADD(str, sep, cond, field) \ 71#define ADD(str, sep, cond, field) \
42do { \ 72do { \
43 strcat(str, sep); \ 73 strcat(str, sep); \
@@ -289,6 +319,7 @@ static int do_hid_entry(const char *filename,
289 319
290 return 1; 320 return 1;
291} 321}
322ADD_TO_DEVTABLE("hid", struct hid_device_id, do_hid_entry);
292 323
293/* Looks like: ieee1394:venNmoNspNverN */ 324/* Looks like: ieee1394:venNmoNspNverN */
294static int do_ieee1394_entry(const char *filename, 325static int do_ieee1394_entry(const char *filename,
@@ -313,6 +344,7 @@ static int do_ieee1394_entry(const char *filename,
313 add_wildcard(alias); 344 add_wildcard(alias);
314 return 1; 345 return 1;
315} 346}
347ADD_TO_DEVTABLE("ieee1394", struct ieee1394_device_id, do_ieee1394_entry);
316 348
317/* Looks like: pci:vNdNsvNsdNbcNscNiN. */ 349/* Looks like: pci:vNdNsvNsdNbcNscNiN. */
318static int do_pci_entry(const char *filename, 350static int do_pci_entry(const char *filename,
@@ -356,6 +388,7 @@ static int do_pci_entry(const char *filename,
356 add_wildcard(alias); 388 add_wildcard(alias);
357 return 1; 389 return 1;
358} 390}
391ADD_TO_DEVTABLE("pci", struct pci_device_id, do_pci_entry);
359 392
360/* looks like: "ccw:tNmNdtNdmN" */ 393/* looks like: "ccw:tNmNdtNdmN" */
361static int do_ccw_entry(const char *filename, 394static int do_ccw_entry(const char *filename,
@@ -379,6 +412,7 @@ static int do_ccw_entry(const char *filename,
379 add_wildcard(alias); 412 add_wildcard(alias);
380 return 1; 413 return 1;
381} 414}
415ADD_TO_DEVTABLE("ccw", struct ccw_device_id, do_ccw_entry);
382 416
383/* looks like: "ap:tN" */ 417/* looks like: "ap:tN" */
384static int do_ap_entry(const char *filename, 418static int do_ap_entry(const char *filename,
@@ -387,6 +421,7 @@ static int do_ap_entry(const char *filename,
387 sprintf(alias, "ap:t%02X*", id->dev_type); 421 sprintf(alias, "ap:t%02X*", id->dev_type);
388 return 1; 422 return 1;
389} 423}
424ADD_TO_DEVTABLE("ap", struct ap_device_id, do_ap_entry);
390 425
391/* looks like: "css:tN" */ 426/* looks like: "css:tN" */
392static int do_css_entry(const char *filename, 427static int do_css_entry(const char *filename,
@@ -395,6 +430,7 @@ static int do_css_entry(const char *filename,
395 sprintf(alias, "css:t%01X", id->type); 430 sprintf(alias, "css:t%01X", id->type);
396 return 1; 431 return 1;
397} 432}
433ADD_TO_DEVTABLE("css", struct css_device_id, do_css_entry);
398 434
399/* Looks like: "serio:tyNprNidNexN" */ 435/* Looks like: "serio:tyNprNidNexN" */
400static int do_serio_entry(const char *filename, 436static int do_serio_entry(const char *filename,
@@ -414,6 +450,7 @@ static int do_serio_entry(const char *filename,
414 add_wildcard(alias); 450 add_wildcard(alias);
415 return 1; 451 return 1;
416} 452}
453ADD_TO_DEVTABLE("serio", struct serio_device_id, do_serio_entry);
417 454
418/* looks like: "acpi:ACPI0003 or acpi:PNP0C0B" or "acpi:LNXVIDEO" */ 455/* looks like: "acpi:ACPI0003 or acpi:PNP0C0B" or "acpi:LNXVIDEO" */
419static int do_acpi_entry(const char *filename, 456static int do_acpi_entry(const char *filename,
@@ -422,6 +459,7 @@ static int do_acpi_entry(const char *filename,
422 sprintf(alias, "acpi*:%s:*", id->id); 459 sprintf(alias, "acpi*:%s:*", id->id);
423 return 1; 460 return 1;
424} 461}
462ADD_TO_DEVTABLE("acpi", struct acpi_device_id, do_acpi_entry);
425 463
426/* looks like: "pnp:dD" */ 464/* looks like: "pnp:dD" */
427static void do_pnp_device_entry(void *symval, unsigned long size, 465static void do_pnp_device_entry(void *symval, unsigned long size,
@@ -544,8 +582,7 @@ static int do_pcmcia_entry(const char *filename,
544 add_wildcard(alias); 582 add_wildcard(alias);
545 return 1; 583 return 1;
546} 584}
547 585ADD_TO_DEVTABLE("pcmcia", struct pcmcia_device_id, do_pcmcia_entry);
548
549 586
550static int do_of_entry (const char *filename, struct of_device_id *of, char *alias) 587static int do_of_entry (const char *filename, struct of_device_id *of, char *alias)
551{ 588{
@@ -568,6 +605,7 @@ static int do_of_entry (const char *filename, struct of_device_id *of, char *ali
568 add_wildcard(alias); 605 add_wildcard(alias);
569 return 1; 606 return 1;
570} 607}
608ADD_TO_DEVTABLE("of", struct of_device_id, do_of_entry);
571 609
572static int do_vio_entry(const char *filename, struct vio_device_id *vio, 610static int do_vio_entry(const char *filename, struct vio_device_id *vio,
573 char *alias) 611 char *alias)
@@ -585,6 +623,7 @@ static int do_vio_entry(const char *filename, struct vio_device_id *vio,
585 add_wildcard(alias); 623 add_wildcard(alias);
586 return 1; 624 return 1;
587} 625}
626ADD_TO_DEVTABLE("vio", struct vio_device_id, do_vio_entry);
588 627
589#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) 628#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
590 629
@@ -640,6 +679,7 @@ static int do_input_entry(const char *filename, struct input_device_id *id,
640 do_input(alias, id->swbit, 0, INPUT_DEVICE_ID_SW_MAX); 679 do_input(alias, id->swbit, 0, INPUT_DEVICE_ID_SW_MAX);
641 return 1; 680 return 1;
642} 681}
682ADD_TO_DEVTABLE("input", struct input_device_id, do_input_entry);
643 683
644static int do_eisa_entry(const char *filename, struct eisa_device_id *eisa, 684static int do_eisa_entry(const char *filename, struct eisa_device_id *eisa,
645 char *alias) 685 char *alias)
@@ -650,6 +690,7 @@ static int do_eisa_entry(const char *filename, struct eisa_device_id *eisa,
650 strcat(alias, "*"); 690 strcat(alias, "*");
651 return 1; 691 return 1;
652} 692}
693ADD_TO_DEVTABLE("eisa", struct eisa_device_id, do_eisa_entry);
653 694
654/* Looks like: parisc:tNhvNrevNsvN */ 695/* Looks like: parisc:tNhvNrevNsvN */
655static int do_parisc_entry(const char *filename, struct parisc_device_id *id, 696static int do_parisc_entry(const char *filename, struct parisc_device_id *id,
@@ -669,6 +710,7 @@ static int do_parisc_entry(const char *filename, struct parisc_device_id *id,
669 add_wildcard(alias); 710 add_wildcard(alias);
670 return 1; 711 return 1;
671} 712}
713ADD_TO_DEVTABLE("parisc", struct parisc_device_id, do_parisc_entry);
672 714
673/* Looks like: sdio:cNvNdN. */ 715/* Looks like: sdio:cNvNdN. */
674static int do_sdio_entry(const char *filename, 716static int do_sdio_entry(const char *filename,
@@ -685,6 +727,7 @@ static int do_sdio_entry(const char *filename,
685 add_wildcard(alias); 727 add_wildcard(alias);
686 return 1; 728 return 1;
687} 729}
730ADD_TO_DEVTABLE("sdio", struct sdio_device_id, do_sdio_entry);
688 731
689/* Looks like: ssb:vNidNrevN. */ 732/* Looks like: ssb:vNidNrevN. */
690static int do_ssb_entry(const char *filename, 733static int do_ssb_entry(const char *filename,
@@ -701,6 +744,7 @@ static int do_ssb_entry(const char *filename,
701 add_wildcard(alias); 744 add_wildcard(alias);
702 return 1; 745 return 1;
703} 746}
747ADD_TO_DEVTABLE("ssb", struct ssb_device_id, do_ssb_entry);
704 748
705/* Looks like: bcma:mNidNrevNclN. */ 749/* Looks like: bcma:mNidNrevNclN. */
706static int do_bcma_entry(const char *filename, 750static int do_bcma_entry(const char *filename,
@@ -719,6 +763,7 @@ static int do_bcma_entry(const char *filename,
719 add_wildcard(alias); 763 add_wildcard(alias);
720 return 1; 764 return 1;
721} 765}
766ADD_TO_DEVTABLE("bcma", struct bcma_device_id, do_bcma_entry);
722 767
723/* Looks like: virtio:dNvN */ 768/* Looks like: virtio:dNvN */
724static int do_virtio_entry(const char *filename, struct virtio_device_id *id, 769static int do_virtio_entry(const char *filename, struct virtio_device_id *id,
@@ -734,6 +779,7 @@ static int do_virtio_entry(const char *filename, struct virtio_device_id *id,
734 add_wildcard(alias); 779 add_wildcard(alias);
735 return 1; 780 return 1;
736} 781}
782ADD_TO_DEVTABLE("virtio", struct virtio_device_id, do_virtio_entry);
737 783
738/* 784/*
739 * Looks like: vmbus:guid 785 * Looks like: vmbus:guid
@@ -755,6 +801,7 @@ static int do_vmbus_entry(const char *filename, struct hv_vmbus_device_id *id,
755 801
756 return 1; 802 return 1;
757} 803}
804ADD_TO_DEVTABLE("vmbus", struct hv_vmbus_device_id, do_vmbus_entry);
758 805
759/* Looks like: i2c:S */ 806/* Looks like: i2c:S */
760static int do_i2c_entry(const char *filename, struct i2c_device_id *id, 807static int do_i2c_entry(const char *filename, struct i2c_device_id *id,
@@ -764,6 +811,7 @@ static int do_i2c_entry(const char *filename, struct i2c_device_id *id,
764 811
765 return 1; 812 return 1;
766} 813}
814ADD_TO_DEVTABLE("i2c", struct i2c_device_id, do_i2c_entry);
767 815
768/* Looks like: spi:S */ 816/* Looks like: spi:S */
769static int do_spi_entry(const char *filename, struct spi_device_id *id, 817static int do_spi_entry(const char *filename, struct spi_device_id *id,
@@ -773,6 +821,7 @@ static int do_spi_entry(const char *filename, struct spi_device_id *id,
773 821
774 return 1; 822 return 1;
775} 823}
824ADD_TO_DEVTABLE("spi", struct spi_device_id, do_spi_entry);
776 825
777static const struct dmifield { 826static const struct dmifield {
778 const char *prefix; 827 const char *prefix;
@@ -827,6 +876,7 @@ static int do_dmi_entry(const char *filename, struct dmi_system_id *id,
827 strcat(alias, ":"); 876 strcat(alias, ":");
828 return 1; 877 return 1;
829} 878}
879ADD_TO_DEVTABLE("dmi", struct dmi_system_id, do_dmi_entry);
830 880
831static int do_platform_entry(const char *filename, 881static int do_platform_entry(const char *filename,
832 struct platform_device_id *id, char *alias) 882 struct platform_device_id *id, char *alias)
@@ -834,6 +884,7 @@ static int do_platform_entry(const char *filename,
834 sprintf(alias, PLATFORM_MODULE_PREFIX "%s", id->name); 884 sprintf(alias, PLATFORM_MODULE_PREFIX "%s", id->name);
835 return 1; 885 return 1;
836} 886}
887ADD_TO_DEVTABLE("platform", struct platform_device_id, do_platform_entry);
837 888
838static int do_mdio_entry(const char *filename, 889static int do_mdio_entry(const char *filename,
839 struct mdio_device_id *id, char *alias) 890 struct mdio_device_id *id, char *alias)
@@ -856,6 +907,7 @@ static int do_mdio_entry(const char *filename,
856 907
857 return 1; 908 return 1;
858} 909}
910ADD_TO_DEVTABLE("mdio", struct mdio_device_id, do_mdio_entry);
859 911
860/* Looks like: zorro:iN. */ 912/* Looks like: zorro:iN. */
861static int do_zorro_entry(const char *filename, struct zorro_device_id *id, 913static int do_zorro_entry(const char *filename, struct zorro_device_id *id,
@@ -866,6 +918,7 @@ static int do_zorro_entry(const char *filename, struct zorro_device_id *id,
866 ADD(alias, "i", id->id != ZORRO_WILDCARD, id->id); 918 ADD(alias, "i", id->id != ZORRO_WILDCARD, id->id);
867 return 1; 919 return 1;
868} 920}
921ADD_TO_DEVTABLE("zorro", struct zorro_device_id, do_zorro_entry);
869 922
870/* looks like: "pnp:dD" */ 923/* looks like: "pnp:dD" */
871static int do_isapnp_entry(const char *filename, 924static int do_isapnp_entry(const char *filename,
@@ -879,16 +932,84 @@ static int do_isapnp_entry(const char *filename,
879 (id->function >> 12) & 0x0f, (id->function >> 8) & 0x0f); 932 (id->function >> 12) & 0x0f, (id->function >> 8) & 0x0f);
880 return 1; 933 return 1;
881} 934}
935ADD_TO_DEVTABLE("isa", struct isapnp_device_id, do_isapnp_entry);
882 936
883/* Ignore any prefix, eg. some architectures prepend _ */ 937/*
884static inline int sym_is(const char *symbol, const char *name) 938 * Append a match expression for a single masked hex digit.
939 * outp points to a pointer to the character at which to append.
940 * *outp is updated on return to point just after the appended text,
941 * to facilitate further appending.
942 */
943static void append_nibble_mask(char **outp,
944 unsigned int nibble, unsigned int mask)
885{ 945{
886 const char *match; 946 char *p = *outp;
947 unsigned int i;
887 948
888 match = strstr(symbol, name); 949 switch (mask) {
889 if (!match) 950 case 0:
890 return 0; 951 *p++ = '?';
891 return match[strlen(name)] == '\0'; 952 break;
953
954 case 0xf:
955 p += sprintf(p, "%X", nibble);
956 break;
957
958 default:
959 /*
960 * Dumbly emit a match pattern for all possible matching
961 * digits. This could be improved in some cases using ranges,
962 * but it has the advantage of being trivially correct, and is
963 * often optimal.
964 */
965 *p++ = '[';
966 for (i = 0; i < 0x10; i++)
967 if ((i & mask) == nibble)
968 p += sprintf(p, "%X", i);
969 *p++ = ']';
970 }
971
972 /* Ensure that the string remains NUL-terminated: */
973 *p = '\0';
974
975 /* Advance the caller's end-of-string pointer: */
976 *outp = p;
977}
978
979/*
980 * looks like: "amba:dN"
981 *
982 * N is exactly 8 digits, where each is an upper-case hex digit, or
983 * a ? or [] pattern matching exactly one digit.
984 */
985static int do_amba_entry(const char *filename,
986 struct amba_id *id, char *alias)
987{
988 unsigned int digit;
989 char *p = alias;
990
991 if ((id->id & id->mask) != id->id)
992 fatal("%s: Masked-off bit(s) of AMBA device ID are non-zero: "
993 "id=0x%08X, mask=0x%08X. Please fix this driver.\n",
994 filename, id->id, id->mask);
995
996 p += sprintf(alias, "amba:d");
997 for (digit = 0; digit < 8; digit++)
998 append_nibble_mask(&p,
999 (id->id >> (4 * (7 - digit))) & 0xf,
1000 (id->mask >> (4 * (7 - digit))) & 0xf);
1001
1002 return 1;
1003}
1004ADD_TO_DEVTABLE("amba", struct amba_id, do_amba_entry);
1005
1006/* Does namelen bytes of name exactly match the symbol? */
1007static bool sym_is(const char *name, unsigned namelen, const char *symbol)
1008{
1009 if (namelen != strlen(symbol))
1010 return false;
1011
1012 return memcmp(name, symbol, namelen) == 0;
892} 1013}
893 1014
894static void do_table(void *symval, unsigned long size, 1015static void do_table(void *symval, unsigned long size,
@@ -921,11 +1042,25 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
921{ 1042{
922 void *symval; 1043 void *symval;
923 char *zeros = NULL; 1044 char *zeros = NULL;
1045 const char *name;
1046 unsigned int namelen;
924 1047
925 /* We're looking for a section relative symbol */ 1048 /* We're looking for a section relative symbol */
926 if (!sym->st_shndx || get_secindex(info, sym) >= info->num_sections) 1049 if (!sym->st_shndx || get_secindex(info, sym) >= info->num_sections)
927 return; 1050 return;
928 1051
1052 /* All our symbols are of form <prefix>__mod_XXX_device_table. */
1053 name = strstr(symname, "__mod_");
1054 if (!name)
1055 return;
1056 name += strlen("__mod_");
1057 namelen = strlen(name);
1058 if (namelen < strlen("_device_table"))
1059 return;
1060 if (strcmp(name + namelen - strlen("_device_table"), "_device_table"))
1061 return;
1062 namelen -= strlen("_device_table");
1063
929 /* Handle all-NULL symbols allocated into .bss */ 1064 /* Handle all-NULL symbols allocated into .bss */
930 if (info->sechdrs[get_secindex(info, sym)].sh_type & SHT_NOBITS) { 1065 if (info->sechdrs[get_secindex(info, sym)].sh_type & SHT_NOBITS) {
931 zeros = calloc(1, sym->st_size); 1066 zeros = calloc(1, sym->st_size);
@@ -936,117 +1071,24 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
936 + sym->st_value; 1071 + sym->st_value;
937 } 1072 }
938 1073
939 if (sym_is(symname, "__mod_pci_device_table")) 1074 /* First handle the "special" cases */
940 do_table(symval, sym->st_size, 1075 if (sym_is(name, namelen, "usb"))
941 sizeof(struct pci_device_id), "pci",
942 do_pci_entry, mod);
943 else if (sym_is(symname, "__mod_usb_device_table"))
944 /* special case to handle bcdDevice ranges */
945 do_usb_table(symval, sym->st_size, mod); 1076 do_usb_table(symval, sym->st_size, mod);
946 else if (sym_is(symname, "__mod_hid_device_table")) 1077 else if (sym_is(name, namelen, "pnp"))
947 do_table(symval, sym->st_size,
948 sizeof(struct hid_device_id), "hid",
949 do_hid_entry, mod);
950 else if (sym_is(symname, "__mod_ieee1394_device_table"))
951 do_table(symval, sym->st_size,
952 sizeof(struct ieee1394_device_id), "ieee1394",
953 do_ieee1394_entry, mod);
954 else if (sym_is(symname, "__mod_ccw_device_table"))
955 do_table(symval, sym->st_size,
956 sizeof(struct ccw_device_id), "ccw",
957 do_ccw_entry, mod);
958 else if (sym_is(symname, "__mod_ap_device_table"))
959 do_table(symval, sym->st_size,
960 sizeof(struct ap_device_id), "ap",
961 do_ap_entry, mod);
962 else if (sym_is(symname, "__mod_css_device_table"))
963 do_table(symval, sym->st_size,
964 sizeof(struct css_device_id), "css",
965 do_css_entry, mod);
966 else if (sym_is(symname, "__mod_serio_device_table"))
967 do_table(symval, sym->st_size,
968 sizeof(struct serio_device_id), "serio",
969 do_serio_entry, mod);
970 else if (sym_is(symname, "__mod_acpi_device_table"))
971 do_table(symval, sym->st_size,
972 sizeof(struct acpi_device_id), "acpi",
973 do_acpi_entry, mod);
974 else if (sym_is(symname, "__mod_pnp_device_table"))
975 do_pnp_device_entry(symval, sym->st_size, mod); 1078 do_pnp_device_entry(symval, sym->st_size, mod);
976 else if (sym_is(symname, "__mod_pnp_card_device_table")) 1079 else if (sym_is(name, namelen, "pnp_card"))
977 do_pnp_card_entries(symval, sym->st_size, mod); 1080 do_pnp_card_entries(symval, sym->st_size, mod);
978 else if (sym_is(symname, "__mod_pcmcia_device_table")) 1081 else {
979 do_table(symval, sym->st_size, 1082 struct devtable **p;
980 sizeof(struct pcmcia_device_id), "pcmcia", 1083
981 do_pcmcia_entry, mod); 1084 for (p = __start___devtable; p < __stop___devtable; p++) {
982 else if (sym_is(symname, "__mod_of_device_table")) 1085 if (sym_is(name, namelen, (*p)->device_id)) {
983 do_table(symval, sym->st_size, 1086 do_table(symval, sym->st_size, (*p)->id_size,
984 sizeof(struct of_device_id), "of", 1087 (*p)->device_id, (*p)->function, mod);
985 do_of_entry, mod); 1088 break;
986 else if (sym_is(symname, "__mod_vio_device_table")) 1089 }
987 do_table(symval, sym->st_size, 1090 }
988 sizeof(struct vio_device_id), "vio", 1091 }
989 do_vio_entry, mod);
990 else if (sym_is(symname, "__mod_input_device_table"))
991 do_table(symval, sym->st_size,
992 sizeof(struct input_device_id), "input",
993 do_input_entry, mod);
994 else if (sym_is(symname, "__mod_eisa_device_table"))
995 do_table(symval, sym->st_size,
996 sizeof(struct eisa_device_id), "eisa",
997 do_eisa_entry, mod);
998 else if (sym_is(symname, "__mod_parisc_device_table"))
999 do_table(symval, sym->st_size,
1000 sizeof(struct parisc_device_id), "parisc",
1001 do_parisc_entry, mod);
1002 else if (sym_is(symname, "__mod_sdio_device_table"))
1003 do_table(symval, sym->st_size,
1004 sizeof(struct sdio_device_id), "sdio",
1005 do_sdio_entry, mod);
1006 else if (sym_is(symname, "__mod_ssb_device_table"))
1007 do_table(symval, sym->st_size,
1008 sizeof(struct ssb_device_id), "ssb",
1009 do_ssb_entry, mod);
1010 else if (sym_is(symname, "__mod_bcma_device_table"))
1011 do_table(symval, sym->st_size,
1012 sizeof(struct bcma_device_id), "bcma",
1013 do_bcma_entry, mod);
1014 else if (sym_is(symname, "__mod_virtio_device_table"))
1015 do_table(symval, sym->st_size,
1016 sizeof(struct virtio_device_id), "virtio",
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);
1022 else if (sym_is(symname, "__mod_i2c_device_table"))
1023 do_table(symval, sym->st_size,
1024 sizeof(struct i2c_device_id), "i2c",
1025 do_i2c_entry, mod);
1026 else if (sym_is(symname, "__mod_spi_device_table"))
1027 do_table(symval, sym->st_size,
1028 sizeof(struct spi_device_id), "spi",
1029 do_spi_entry, mod);
1030 else if (sym_is(symname, "__mod_dmi_device_table"))
1031 do_table(symval, sym->st_size,
1032 sizeof(struct dmi_system_id), "dmi",
1033 do_dmi_entry, mod);
1034 else if (sym_is(symname, "__mod_platform_device_table"))
1035 do_table(symval, sym->st_size,
1036 sizeof(struct platform_device_id), "platform",
1037 do_platform_entry, mod);
1038 else if (sym_is(symname, "__mod_mdio_device_table"))
1039 do_table(symval, sym->st_size,
1040 sizeof(struct mdio_device_id), "mdio",
1041 do_mdio_entry, mod);
1042 else if (sym_is(symname, "__mod_zorro_device_table"))
1043 do_table(symval, sym->st_size,
1044 sizeof(struct zorro_device_id), "zorro",
1045 do_zorro_entry, mod);
1046 else if (sym_is(symname, "__mod_isapnp_device_table"))
1047 do_table(symval, sym->st_size,
1048 sizeof(struct isapnp_device_id), "isa",
1049 do_isapnp_entry, mod);
1050 free(zeros); 1092 free(zeros);
1051} 1093}
1052 1094