Re: [PATCH v2 02/13] ASoC: mediatek: mt8189: Propagate APLL enable errors
From: AngeloGioacchino Del Regno
Date: Mon Sep 14 2026 - 12:14:09 EST
On 9/14/26 15:47, Mark Brown wrote:
On Mon, Sep 14, 2026 at 03:22:21PM +0200, AngeloGioacchino Del Regno wrote:
On 9/14/26 09:28, phucduc.bui@xxxxxxxxx wrote:
+ ret = regmap_update_bits(afe->regmap, AFE_APLL2_TUNER_CFG,
Well, this is a bit of defensive programming here.
The regmap pointer is already checked by the previous function call, and this is
a regmap over MMIO... and MMIO writes can't fail.
Oh, you sweet summer child :) .
lmao
Though practically speaking the error
handling ends up being the same as if they couldn't fail since if
something goes wrong it's generally catastrophic stuff like locking the
core up completely so the end result is the same.
That was also an implicit point (that should've been explicit from me): if anything
goes horribly wrong here, it means that it already went horribly wrong "some
function calls ago", and the platform likely already locked up as you suggested.
In any case, I'm not against doing error checking, it's just about not doing it
when it's really useless (I'm sure you understand my reasons), and I believe this
specific case is one of those.
That said, should you prefer having error checks in such places... it's not a
performance path, so I don't really have strong opinions really.
Cheers!
Angelo