public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] module device table restoration
@ 2002-11-20  7:00 Rusty Russell
  2002-11-20  8:09 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Rusty Russell @ 2002-11-20  7:00 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, Adam J. Richter

Patch from Adam Richter.  I have a nicer solution based on aliases,
but it requires coordination with USB, PCI and PCMCIA maintainers,
which is taking time.

This restores the old code in the meantime: one week without this is
too long or people who need it.  8(

Please apply unless Adam has objections,
Rusty.

--- linux-2.5.48/include/linux/module.h	2002-11-17 20:29:52.000000000 -0800
+++ linux/include/linux/module.h	2002-11-18 08:05:19.000000000 -0800
@@ -26,8 +26,6 @@
 #define MODULE_AUTHOR(name)
 #define MODULE_DESCRIPTION(desc)
 #define MODULE_SUPPORTED_DEVICE(name)
-#define MODULE_GENERIC_TABLE(gtype,name)
-#define MODULE_DEVICE_TABLE(type,name)
 #define MODULE_PARM_DESC(var,desc)
 #define print_symbol(format, addr)
 #define print_modules()
@@ -40,14 +38,28 @@
 };
 
 #ifdef MODULE
+
+#define MODULE_GENERIC_TABLE(gtype,name)	\
+static const unsigned long __module_##gtype##_size \
+  __attribute__ ((unused)) = sizeof(struct gtype##_id); \
+static const struct gtype##_id * __module_##gtype##_table \
+  __attribute__ ((unused)) = name
+
 /* This is magically filled in by the linker, but THIS_MODULE must be
    a constant so it works in initializers. */
 extern struct module __this_module;
 #define THIS_MODULE (&__this_module)
-#else
+
+#else  /* !MODULE */
+
+#define MODULE_GENERIC_TABLE(gtype,name)
 #define THIS_MODULE ((struct module *)0)
+
 #endif
 
+#define MODULE_DEVICE_TABLE(type,name)		\
+  MODULE_GENERIC_TABLE(type##_device,name)
+
 #ifdef CONFIG_MODULES
 /* Get/put a kernel symbol (calls must be symmetric) */
 void *__symbol_get(const char *symbol);

^ permalink raw reply	[flat|nested] 3+ messages in thread
* Re: [PATCH] module device table restoration
@ 2002-11-20 11:32 Adam J. Richter
  0 siblings, 0 replies; 3+ messages in thread
From: Adam J. Richter @ 2002-11-20 11:32 UTC (permalink / raw)
  To: rusty, torvalds; +Cc: linux-kernel

Rusty Russell writes:
>Please apply unless Adam has objections,
>Rusty.

	No objections.  Thanks!

Adam J. Richter     __     ______________   575 Oroville Road
adam@yggdrasil.com     \ /                  Milpitas, California 95035
+1 408 309-6081         | g g d r a s i l   United States of America
                         "Free Software For The Rest Of Us."

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-11-20 11:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-20  7:00 [PATCH] module device table restoration Rusty Russell
2002-11-20  8:09 ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2002-11-20 11:32 Adam J. Richter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox