[PATCH 0/5] ASoC: mediatek: mt8186: Fix clock error handling

phucduc.bui at gmail.com phucduc.bui at gmail.com
Thu Aug 20 04:12:48 PDT 2026


From: bui duc phuc <phucduc.bui at gmail.com>

Hi all,

This series fixes error handling in the MT8186 AFE clock code.

The current code can return from clock operations without cleaning up
clocks that were already enabled, and can ignore clock lookup errors
while later using the affected clock pointers.

This series keeps devm_clk_get() and propagates clock lookup errors
instead of silently continuing with a NULL clock.

The changes therefore assume that the clocks used by the driver are
required. If these clocks are intended to be optional and
devm_clk_get_optional() is preferred, the clock users would also need
to check for missing clocks before calling clock APIs such as
clk_prepare_enable(), clk_disable_unprepare(), and clk_set_parent().

If that is the preferred approach, I can rework the series accordingly.

The changes were found by manual code inspection and compile-tested
only.

Best regards,
Phuc


bui duc phuc (5):
  ASoC: mediatek: mt8186: fix APLL mux setting error handling
  ASoC: mediatek: mt8186: Fix AFE clock error handling
  ASoC: mediatek: mt8186: Fix APLL enable error handling
  ASoC: mediatek: mt8186: Fix MCK error handling
  ASoC: mediatek: mt8186: Propagate clock lookup errors

 sound/soc/mediatek/mt8186/mt8186-afe-clk.c | 112 ++++++++++++++-------
 1 file changed, 74 insertions(+), 38 deletions(-)

-- 
2.43.0




More information about the Linux-mediatek mailing list