Re: [PATCH v3 25/27] ASoC: codecs: rt712: Use guard() for mutex locks

From: Bui Duc Phuc

Date: Sun Jul 12 2026 - 22:26:37 EST


Another point is: when should regcache_sync() be considered to have failed?

>From my understanding, if patch application or cache synchronization fails
before reaching the out: label, then regcache_sync() has already failed and
should return that error.
However, the function currently uses a single ret variable throughout
the entire flow.
To make the failure semantics clearer, I'm planning to submit the
following follow-up patch.
I'd appreciate any feedback.

------------------
int paging_ret = 0;
/* ... */
out:
/* ... */

paging_ret = _regmap_write(map, this->selector_reg, i);
if (paging_ret) {
dev_err(...);
map->cache_dirty = true;
break;
}
/* ... */
return ret ? ret : paging_ret;
-------------------

This preserves any error that occurred before out: while also
reporting errors that occur after out:.

Best regards.
Phuc