Skip to contentSkip to conversation

miscdevice: introduce builtin_misc_device

PATCH In review Paul Gortmaker 2 participants 2 messages Oct 22, 2016 – Oct 28, 2016 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 miscdevice: introduce builtin_misc_device

This is basically the same as module_misc_device but without the
presence of an exit/remove function. Similar in nature to the
commit f309d4443130bf814e991f836e919dca22df37ae ("platform_device:
better support builtin boilerplate avoidance").

Cc Arnd Bergmann <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>

---

[I've got several users of this in my local queue; but I'll stagger
those and this by a merge window to avoid dependency issues.]

 include/linux/miscdevice.h | 7 +++++++
 1 file changed, 7 insertions(+)
include/linux/miscdevice.h +7 -0
index 722698a43d79..a426cb55dc43 100644
@@ -72,6 +72,13 @@ extern int misc_register(struct miscdevice *misc);
 extern void misc_deregister(struct miscdevice *misc);
 
 /*
+ * Helper macro for drivers that don't do anything special in the initcall.
+ * This helps in eleminating of boilerplate code.
+ */
+#define builtin_misc_device(__misc_device) \
+	builtin_driver(__misc_device, misc_register)
+
+/*
  * Helper macro for drivers that don't do anything special in module init / exit
  * call. This helps in eleminating of boilerplate code.
  */
Signature · 1 line
2.8.4
#1 lore raw
Quoted 11 lines · Paul Gortmaker

This is basically the same as module_misc_device but without the
presence of an exit/remove function. Similar in nature to the
commit f309d4443130bf814e991f836e919dca22df37ae ("platform_device:
better support builtin boilerplate avoidance").

---

[I've got several users of this in my local queue; but I'll stagger
those and this by a merge window to avoid dependency issues.]

Send them on, I'll be glad to take them through my tree if you want to.

thanks,

greg k-h