Skip to content

Commit cacce07

Browse files
haukeKalle Valo
authored andcommitted
bcma: add module_bcma_driver()
This makes it possible to save some lines of code in drivers with an simple bcma driver registration. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
1 parent f911085 commit cacce07

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎include/linux/bcma/bcma.h‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,15 @@ int __bcma_driver_register(struct bcma_driver *drv, struct module *owner);
305305

306306
extern void bcma_driver_unregister(struct bcma_driver *drv);
307307

308+
/* module_bcma_driver() - Helper macro for drivers that don't do
309+
* anything special in module init/exit. This eliminates a lot of
310+
* boilerplate. Each module may only use this macro once, and
311+
* calling it replaces module_init() and module_exit()
312+
*/
313+
#define module_bcma_driver(__bcma_driver) \
314+
module_driver(__bcma_driver, bcma_driver_register, \
315+
bcma_driver_unregister)
316+
308317
/* Set a fallback SPROM.
309318
* See kdoc at the function definition for complete documentation. */
310319
extern int bcma_arch_register_fallback_sprom(

0 commit comments

Comments
 (0)