• Peter Hurley's avatar
    serial: earlycon: Fixup earlycon console name and index · cda64e68
    Peter Hurley authored
    Properly initialize the struct console 'name' and 'index' fields for
    the registering earlycon. For earlycons w/o trailing numerals, the
    index is set to 0; otherwise, the index is set to the value of the
    trailing numeral. For example, the 'exynos4210' earlycon name == "exynos"
    and index == 4210. Earlycons with embedded numerals will have all
    non-trailing numerals as part of the name; for example, the 's3c2412'
    earlycon name == "s3c" and index == 2412.
    
    This ackward scheme was initially added for the uart8250 earlycon;
    adopt this scheme for the other earlycon "drivers".
    
    Introduce earlycon_init() which performs the string scanning and
    initializes the name and index fields; encapsulate the other console
    field initializations within.
    Acked-by: default avatarRob Herring <robh@kernel.org>
    Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    cda64e68
earlycon.c 5.83 KB