Re: [PATCH] serial: mvebu-uart: disable the clock when probe fails
From: Miquel Raynal
Date: Thu Dec 03 2026 - 05:53:13 EST
Hi Arina,
On 29/11/2026 at 11:28:12 +04, Arina Kharlamova via B4 Relay <devnull+arina.kharlamova.mbzuai.ac.ae@xxxxxxxxxx> wrote:
> From: Arina Kharlamova <arina.kharlamova@xxxxxxxxxxxx>
>
> mvebu_uart_probe() prepares and enables the UART clock, but the later
> returns for a missing interrupt, including -EPROBE_DEFER from
> platform_get_irq(), and for a failed uart_add_one_port() leave it
> enabled. The clock comes from devm_clk_get(), so devres only puts it,
> and every deferred probe raises the enable count by one more.
Wouldn't using devm_clk_get_optional_enabled() (or a similar function)
be more suitable and avoid most of the churn introduced by this patch?
Thanks,
Miquèl