Skip to content

Commit

Permalink
pcmcia/ds.h: introduce helper for pcmcia_driver module boilerplate
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
bigguiness authored and gregkh committed Mar 15, 2013
1 parent e7c2199 commit 6ed7ffd
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions include/pcmcia/ds.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,18 @@ struct pcmcia_driver {
int pcmcia_register_driver(struct pcmcia_driver *driver);
void pcmcia_unregister_driver(struct pcmcia_driver *driver);

/**
* module_pcmcia_driver() - Helper macro for registering a pcmcia driver
* @__pcmcia_driver: pcmcia_driver struct
*
* Helper macro for pcmcia drivers which do not do anything special in module
* init/exit. This eliminates a lot of boilerplate. Each module may only use
* this macro once, and calling it replaces module_init() and module_exit().
*/
#define module_pcmcia_driver(__pcmcia_driver) \
module_driver(__pcmcia_driver, pcmcia_register_driver, \
pcmcia_unregister_driver)

/* for struct resource * array embedded in struct pcmcia_device */
enum {
PCMCIA_IOPORT_0,
Expand Down

0 comments on commit 6ed7ffd

Please sign in to comment.