]> git.karo-electronics.de Git - linux-beck.git/blobdiff - include/linux/serial_core.h
Merge branch 'i2c/for-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
[linux-beck.git] / include / linux / serial_core.h
index a3d7c0d4a03e75016023184a5fea18c91d9d8dbc..2f44e20136545162d15ee9a39c2eae38352580d1 100644 (file)
@@ -352,9 +352,15 @@ struct earlycon_id {
 extern const struct earlycon_id __earlycon_table[];
 extern const struct earlycon_id __earlycon_table_end[];
 
+#if defined(CONFIG_SERIAL_EARLYCON) && !defined(MODULE)
+#define EARLYCON_USED_OR_UNUSED        __used
+#else
+#define EARLYCON_USED_OR_UNUSED        __maybe_unused
+#endif
+
 #define OF_EARLYCON_DECLARE(_name, compat, fn)                         \
        static const struct earlycon_id __UNIQUE_ID(__earlycon_##_name) \
-            __used __section(__earlycon_table)                         \
+            EARLYCON_USED_OR_UNUSED __section(__earlycon_table)        \
                = { .name = __stringify(_name),                         \
                    .compatible = compat,                               \
                    .setup = fn  }