Re: [PATCH 1/8] xtensa: ISS: don't panic in rs_init

From: Max Filippov
Date: Fri Jul 23 2021 - 06:18:22 EST


On Fri, Jul 23, 2021 at 12:43 AM Jiri Slaby <jslaby@xxxxxxx> wrote:
>
> While alloc_tty_driver failure in rs_init would mean we have much bigger
> problem, there is no reason to panic when tty_register_driver fails
> there. It can fail for various reasons.
>
> So handle the failure gracefully. Actually handle them both while at it.
> This will make at least the console functional as it was enabled earlier
> by console_initcall in iss_console_init. Instead of shooting down the
> whole system.
>
> We move tty_port_init() after alloc_tty_driver(), so that we don't need
> to destroy the port in case the latter function fails.
>
> Signed-off-by: Jiri Slaby <jslaby@xxxxxxx>
> Cc: Chris Zankel <chris@xxxxxxxxxx>
> Cc: Max Filippov <jcmvbkbc@xxxxxxxxx>
> Cc: linux-xtensa@xxxxxxxxxxxxxxxx
> ---
> arch/xtensa/platforms/iss/console.c | 17 ++++++++++++++---
> 1 file changed, 14 insertions(+), 3 deletions(-)

Acked-by: Max Filippov <jcmvbkbc@xxxxxxxxx>

--
Thanks.
-- Max