miscdevice: introduce builtin_misc_device
authorPaul Gortmaker <paul.gortmaker@windriver.com>
Sat, 22 Oct 2016 22:36:05 +0000 (18:36 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 28 Oct 2016 12:22:11 +0000 (08:22 -0400)
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 <arnd@arndb.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/miscdevice.h

index 722698a43d79c906f933513c201e369be339c2b8..a426cb55dc43b9ff6c02b00293d3b24b9881c4ea 100644 (file)
@@ -71,6 +71,13 @@ struct miscdevice  {
 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.