diff options
Diffstat (limited to 'include/linux/serial_core.h')
-rw-r--r-- | include/linux/serial_core.h | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 1d356105f25a..b4c9fda9d833 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -351,10 +351,10 @@ struct earlycon_id { | |||
351 | char name[16]; | 351 | char name[16]; |
352 | char compatible[128]; | 352 | char compatible[128]; |
353 | int (*setup)(struct earlycon_device *, const char *options); | 353 | int (*setup)(struct earlycon_device *, const char *options); |
354 | } __aligned(32); | 354 | }; |
355 | 355 | ||
356 | extern const struct earlycon_id __earlycon_table[]; | 356 | extern const struct earlycon_id *__earlycon_table[]; |
357 | extern const struct earlycon_id __earlycon_table_end[]; | 357 | extern const struct earlycon_id *__earlycon_table_end[]; |
358 | 358 | ||
359 | #if defined(CONFIG_SERIAL_EARLYCON) && !defined(MODULE) | 359 | #if defined(CONFIG_SERIAL_EARLYCON) && !defined(MODULE) |
360 | #define EARLYCON_USED_OR_UNUSED __used | 360 | #define EARLYCON_USED_OR_UNUSED __used |
@@ -362,12 +362,19 @@ extern const struct earlycon_id __earlycon_table_end[]; | |||
362 | #define EARLYCON_USED_OR_UNUSED __maybe_unused | 362 | #define EARLYCON_USED_OR_UNUSED __maybe_unused |
363 | #endif | 363 | #endif |
364 | 364 | ||
365 | #define OF_EARLYCON_DECLARE(_name, compat, fn) \ | 365 | #define _OF_EARLYCON_DECLARE(_name, compat, fn, unique_id) \ |
366 | static const struct earlycon_id __UNIQUE_ID(__earlycon_##_name) \ | 366 | static const struct earlycon_id unique_id \ |
367 | EARLYCON_USED_OR_UNUSED __section(__earlycon_table) \ | 367 | EARLYCON_USED_OR_UNUSED __initconst \ |
368 | = { .name = __stringify(_name), \ | 368 | = { .name = __stringify(_name), \ |
369 | .compatible = compat, \ | 369 | .compatible = compat, \ |
370 | .setup = fn } | 370 | .setup = fn }; \ |
371 | static const struct earlycon_id EARLYCON_USED_OR_UNUSED \ | ||
372 | __section(__earlycon_table) \ | ||
373 | * const __PASTE(__p, unique_id) = &unique_id | ||
374 | |||
375 | #define OF_EARLYCON_DECLARE(_name, compat, fn) \ | ||
376 | _OF_EARLYCON_DECLARE(_name, compat, fn, \ | ||
377 | __UNIQUE_ID(__earlycon_##_name)) | ||
371 | 378 | ||
372 | #define EARLYCON_DECLARE(_name, fn) OF_EARLYCON_DECLARE(_name, "", fn) | 379 | #define EARLYCON_DECLARE(_name, fn) OF_EARLYCON_DECLARE(_name, "", fn) |
373 | 380 | ||