From 92919889ad68b2631f51905f7a329ca5ee2ac28c Mon Sep 17 00:00:00 2001 From: Paul Gortmaker Date: Sat, 22 Oct 2016 18:36:05 -0400 Subject: [PATCH] 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 517629972ab0c4c17b3549fff94bf67c4b8b0153 ("platform_device: better support builtin boilerplate avoidance"). Cc: Arnd Bergmann Signed-off-by: Paul Gortmaker Signed-off-by: Greg Kroah-Hartman --- include/linux/miscdevice.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h index 722698a43d79c..a426cb55dc43b 100644 --- a/include/linux/miscdevice.h +++ b/include/linux/miscdevice.h @@ -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. -- 2.39.5