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

Bui Duc Phuc phucduc.bui at gmail.com
Sun Jul 12 19:26:14 PDT 2026


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



More information about the Linux-mediatek mailing list