Re: [PATCH v5 05/16] printk: Prefer the console either via name or devname exclusively
From: John Ogness
Date: Tue Oct 27 2026 - 08:26:23 EST
On 2026-09-29, Petr Mladek <pmladek@xxxxxxxx> wrote:
> The commit 7640f1a44eba0cc1a4 ("printk:
> Add match_devname_and_update_preferred_console()") added the possibility
> to prefer a console driver via device name. The name of the console driver
> gets assigned when the device gets initialized and it triers whether
> it is eligible for a console.
>
> The above mentioned commit ensures that __add_preferred_console() is called
> at least with name or devname value. But it does not check whether
> both are defined which is a non-sense.
>
> Add the check and do not fail quietly. Also shuffle the code a bit
> to make it ready for adding more checks.
>
> Signed-off-by: Petr Mladek <pmladek@xxxxxxxx>
Reviewed-by: John Ogness <john.ogness@xxxxxxxxxxxxx>