Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pcmcia/ds.h: introduce helper for pcmcia_driver module boilerplate

Introduce the module_pcmcia_driver() macro which is a convenience macro
for pcmcia driver modules. It is intended to be used by pcmcia drivers
with init/exit sections that do nothing but register/unregister the
pcmcia driver.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: linux-pcmcia@lists.infradead.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

H Hartley Sweeten and committed by
Greg Kroah-Hartman
6ed7ffdd e7c2199f

+12
+12
include/pcmcia/ds.h
··· 65 65 int pcmcia_register_driver(struct pcmcia_driver *driver); 66 66 void pcmcia_unregister_driver(struct pcmcia_driver *driver); 67 67 68 + /** 69 + * module_pcmcia_driver() - Helper macro for registering a pcmcia driver 70 + * @__pcmcia_driver: pcmcia_driver struct 71 + * 72 + * Helper macro for pcmcia drivers which do not do anything special in module 73 + * init/exit. This eliminates a lot of boilerplate. Each module may only use 74 + * this macro once, and calling it replaces module_init() and module_exit(). 75 + */ 76 + #define module_pcmcia_driver(__pcmcia_driver) \ 77 + module_driver(__pcmcia_driver, pcmcia_register_driver, \ 78 + pcmcia_unregister_driver) 79 + 68 80 /* for struct resource * array embedded in struct pcmcia_device */ 69 81 enum { 70 82 PCMCIA_IOPORT_0,