Re: [PATCH] serial: max3100: unwind port allocation on add failure
From: Andy Shevchenko
Date: Tue Apr 28 2026 - 03:52:37 EST
On Tue, Apr 28, 2026 at 04:07:27PM +0900, 박명훈 wrote:
> max3100_probe() reports errors from uart_add_one_port(), but then
> continues initialization and returns success. The device is left with
> per-port state in max3100s[] even though serial core did not add the
> port.
>
> Return the uart_add_one_port() error instead. Free the per-port state
> and, when no other chips remain, unregister the UART driver that probe
> registered.
NAK.
Please, try to understand why we do like this and how important is to have at
least some of the ports available (yes, I understand that this is not a robust
solution, but it might help in the unlikely cases when some of the ports are
failed to get instantiated.
--
With Best Regards,
Andy Shevchenko