# Re: \[PATCH 1/8\] xtensa: ISS: don't panic in rs\_init

- From: Max Filippov \<jcmvbkbc@gmail.com\>
- Date: 2021-07-23 10:18:22 
- List: linux-serial
- Page: https://ratatoskr.run/linux-serial/2021/07/1455772
- Thread: https://ratatoskr.run/linux-serial/2021/07/1455609/t.md

```text
On Fri, Jul 23, 2021 at 12:43 AM Jiri Slaby [ref] 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 <redacted>
> Cc: Chris Zankel <chris@zankel.net>
> Cc: Max Filippov <jcmvbkbc@gmail.com>
> Cc: <redacted>
> ---
>  arch/xtensa/platforms/iss/console.c | 17 ++++++++++++++---
>  1 file changed, 14 insertions(+), 3 deletions(-)

Acked-by: Max Filippov <jcmvbkbc@gmail.com>

-- 
Thanks.
-- Max
```
