All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bcma: add module_bcma_driver()
@ 2015-05-14 21:05 Hauke Mehrtens
  2015-05-26 11:04 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Hauke Mehrtens @ 2015-05-14 21:05 UTC (permalink / raw)
  To: kvalo; +Cc: zajec5, linux-wireless, Hauke Mehrtens

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>
---
 include/linux/bcma/bcma.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h
index e34f906..2ff4a99 100644
--- a/include/linux/bcma/bcma.h
+++ b/include/linux/bcma/bcma.h
@@ -305,6 +305,15 @@ int __bcma_driver_register(struct bcma_driver *drv, struct module *owner);
 
 extern void bcma_driver_unregister(struct bcma_driver *drv);
 
+/* module_bcma_driver() - Helper macro for drivers that don't 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_bcma_driver(__bcma_driver) \
+	module_driver(__bcma_driver, bcma_driver_register, \
+			bcma_driver_unregister)
+
 /* Set a fallback SPROM.
  * See kdoc at the function definition for complete documentation. */
 extern int bcma_arch_register_fallback_sprom(
-- 
2.1.4


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

* Re: bcma: add module_bcma_driver()
  2015-05-14 21:05 [PATCH] bcma: add module_bcma_driver() Hauke Mehrtens
@ 2015-05-26 11:04 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2015-05-26 11:04 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: zajec5, linux-wireless, Hauke Mehrtens


> 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>

Thanks, applied to wireless-drivers-next.git.

Kalle Valo

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

end of thread, other threads:[~2015-05-26 14:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-14 21:05 [PATCH] bcma: add module_bcma_driver() Hauke Mehrtens
2015-05-26 11:04 ` Kalle Valo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.