Re: [PATCH v2 13/24] ASoC: codecs: cs35l56: Use guard() and PM runtime scope helpers

Richard Fitzgerald <[email protected]> Mon, 6 Jul 2026 11:58:02 +0100
Newsgroups dev.linux.lists.chrome-platform,dev.linux.lists.asahi,org.kernel.vger.linux-kernel,org.kernel.vger.linux-sound
Message-ID <[email protected]>
On 06/07/2026 11:46 am, Bui Duc Phuc wrote:
> Hi Cezary, Richard,
> 
> Thanks to both of you for the reviews!
> 
>>> -     ret = IRQ_HANDLED;
>>> +     return IRQ_HANDLED;
>>>
>>> -err:
>>> -     pm_runtime_put(cs35l56_base->dev);
>>> -err_unlock:
>>> -     mutex_unlock(&cs35l56_base->irq_lock);
>>> -
>>> -     return ret;
>>>    }
>> Nitpick: this will leave a superfluous newline.
> 
> You're right. I'll remove the extra blank line.
> 
>> It looks like a bug that it checks rv but returns ret.
> 
> I'm not sure I fully understand what you meant by that comment. This
> conversion preserves the existing behavior, so although checking rv
> and returning ret may look a bit odd, I don't think it changes the
> behavior or introduces a bug.
> 

I mean the code is correct but it looks wrong. Because it tests for
an error in rv but then returns a value in ret.

This can be cleaned up now. ret isn't needed because it can return
IRQ_NONE in all these places.

>> The local ret variable can be deleted.
>> Should change all the error returns to directly return IRQ_NONE.
> 
> As you suggested,
> I'll remove the ret variable entirely and return IRQ_NONE /
> IRQ_HANDLED directly.
> 
> Best regards,
> Phuc