Re: [PATCH] ASoC: ES8389: convert to devm_clk_get_optional() to get clock
From: Li Jian
Date: Sat Apr 18 2026 - 04:18:33 EST
Hi Uwe
在 2026/4/17 21:34, Uwe Kleine-König 写道:
Hello,
On Fri, Apr 17, 2026 at 06:53:14PM +0800, Li Jian wrote:
When enabling ES8390 via ACPI description, es8389 would fail to
obtain a clock source, causing the driver to fail to initialize.
This was not an issue with older kernels, but since commit
abae8e57e49a ("clk: generalize devm_clk_get() a bit"),
devm_clk_get() would return an error pointer when a clock source
was not detected (instead of falling back to a static clock),
causing the driver to fail early.
Use devm_clk_get_optional() instead to return to the previous
behaviour, allowing the use of a static clock source.
Cc: stable@xxxxxxxxxxxxxxx
Fixes: abae8e57e49a ("clk: generalize devm_clk_get() a bit")
Are you sure you identified the breaking commit correctly? I intended
the patch not to introduce any semantic change, and even with your claim
I don't spot the issue in abae8e57e49a.
There was a misunderstanding on how the Fixes: tag should be used - I meant to say that your commit changed a behaviour, not that it was broken. I should have pointed to a commit to this driver instead.
In my case, since the device was described in ACPI and it does not export a clock to the operating system, it was then necessary to utilize a fallback. Before your commit, missing clocks returned a NULL pointer. However, your commit correctly makes it return an error pointer instead - now, since the driver initialization checks for error pointers, so I switched to devm_clk_get_optional(), which falls back to a static clock source to avoid this issue on ACPI platforms.
Again, your commit is correct, but I was not using the Fixes: tag correct - indeed, a missing clock should return an error pointer, not NULL. Sorry about that and I will submit v2 to fix this.
Best regards,
Li Jian
> Best regards
> Uwe