mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-09 16:12:21 +00:00
earlycon: mark earlycon code as __used iif the caller is built-in
Keep earlycon related symbols only when CONFIG_SERIAL_EARLYCON is enabled and the driver is built-in. This will be helpful to clean up ifdefs surrounding earlycon code in serial drivers. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
4ef03d3287
commit
f8ba3647f3
1 changed files with 7 additions and 1 deletions
|
@ -352,9 +352,15 @@ struct earlycon_id {
|
||||||
extern const struct earlycon_id __earlycon_table[];
|
extern const struct earlycon_id __earlycon_table[];
|
||||||
extern const struct earlycon_id __earlycon_table_end[];
|
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) \
|
#define OF_EARLYCON_DECLARE(_name, compat, fn) \
|
||||||
static const struct earlycon_id __UNIQUE_ID(__earlycon_##_name) \
|
static const struct earlycon_id __UNIQUE_ID(__earlycon_##_name) \
|
||||||
__used __section(__earlycon_table) \
|
EARLYCON_USED_OR_UNUSED __section(__earlycon_table) \
|
||||||
= { .name = __stringify(_name), \
|
= { .name = __stringify(_name), \
|
||||||
.compatible = compat, \
|
.compatible = compat, \
|
||||||
.setup = fn }
|
.setup = fn }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue