aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2014-02-02 19:45:13 -0500
committerRusty Russell <rusty@rustcorp.com.au>2014-03-12 21:41:00 -0400
commitcff26a51da5d206d3baf871e75778da44710219d (patch)
tree7a2fb0e8338ea79cd735b927add6bb2908ca23b3
parent21bdd17b21b45ea48e06e23918d681afbe0622e9 (diff)
module: remove MODULE_GENERIC_TABLE
MODULE_DEVICE_TABLE() calles MODULE_GENERIC_TABLE(); make it do the work directly. This also removes a wart introduced in the last patch, where the alias is defined to be an unknown struct type "struct type##__##name##_device_id" instead of "struct type##_device_id" (it's an extern so GCC doesn't care, but it's wrong). The other user of MODULE_GENERIC_TABLE (ISAPNP_CARD_TABLE) is unused, so delete it. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-rw-r--r--include/linux/isapnp.h4
-rw-r--r--include/linux/module.h19
2 files changed, 8 insertions, 15 deletions
diff --git a/include/linux/isapnp.h b/include/linux/isapnp.h
index e2d28b026a8c..3c77bf9b1efd 100644
--- a/include/linux/isapnp.h
+++ b/include/linux/isapnp.h
@@ -56,10 +56,6 @@
56#define ISAPNP_DEVICE_ID(_va, _vb, _vc, _function) \ 56#define ISAPNP_DEVICE_ID(_va, _vb, _vc, _function) \
57 { .vendor = ISAPNP_VENDOR(_va, _vb, _vc), .function = ISAPNP_FUNCTION(_function) } 57 { .vendor = ISAPNP_VENDOR(_va, _vb, _vc), .function = ISAPNP_FUNCTION(_function) }
58 58
59/* export used IDs outside module */
60#define ISAPNP_CARD_TABLE(name) \
61 MODULE_GENERIC_TABLE(isapnp_card, name)
62
63struct isapnp_card_id { 59struct isapnp_card_id {
64 unsigned long driver_data; /* data private to the driver */ 60 unsigned long driver_data; /* data private to the driver */
65 unsigned short card_vendor, card_device; 61 unsigned short card_vendor, card_device;
diff --git a/include/linux/module.h b/include/linux/module.h
index ad18f6006f86..5686b37e11d6 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -82,15 +82,6 @@ void sort_extable(struct exception_table_entry *start,
82void sort_main_extable(void); 82void sort_main_extable(void);
83void trim_init_extable(struct module *m); 83void trim_init_extable(struct module *m);
84 84
85#ifdef MODULE
86#define MODULE_GENERIC_TABLE(gtype, name) \
87extern const struct gtype##_id __mod_##gtype##_table \
88 __attribute__ ((unused, alias(__stringify(name))))
89
90#else /* !MODULE */
91#define MODULE_GENERIC_TABLE(gtype, name)
92#endif
93
94/* Generic info of form tag = "info" */ 85/* Generic info of form tag = "info" */
95#define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info) 86#define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info)
96 87
@@ -141,8 +132,14 @@ extern const struct gtype##_id __mod_##gtype##_table \
141/* What your module does. */ 132/* What your module does. */
142#define MODULE_DESCRIPTION(_description) MODULE_INFO(description, _description) 133#define MODULE_DESCRIPTION(_description) MODULE_INFO(description, _description)
143 134
144#define MODULE_DEVICE_TABLE(type, name) \ 135#ifdef MODULE
145 MODULE_GENERIC_TABLE(type##__##name##_device, name) 136/* Creates an alias so file2alias.c can find device table. */
137#define MODULE_DEVICE_TABLE(type, name) \
138 extern const struct type##_device_id __mod_##type##__##name##_device_table \
139 __attribute__ ((unused, alias(__stringify(name))))
140#else /* !MODULE */
141#define MODULE_DEVICE_TABLE(type, name)
142#endif
146 143
147/* Version of form [<epoch>:]<version>[-<extra-version>]. 144/* Version of form [<epoch>:]<version>[-<extra-version>].
148 * Or for CVS/RCS ID version, everything but the number is stripped. 145 * Or for CVS/RCS ID version, everything but the number is stripped.