Re: [PATCH 7/7] ASoC: ti: omap-mcbsp: Simplify lock and resource handling

From: Mark Brown

Date: Sat May 09 2026 - 21:35:30 EST


On Fri, May 08, 2026 at 05:38:37PM +0700, phucduc.bui@xxxxxxxxx wrote:

> Convert spinlock protected sections to guard()/scoped_guard()
> helpers and simplify the cleanup paths, including the
> reg_cache lifetime handling in omap_mcbsp_request().

> static int omap_mcbsp_request(struct omap_mcbsp *mcbsp)
> {
> - void *reg_cache;
> + void *reg_cache __free(kfree) = kzalloc(mcbsp->reg_cache_size, GFP_KERNEL);

> + scoped_guard(spinlock, &mcbsp->lock) {

This function now mixes scoped and goto based cleanup which cleanup.h
warns us not to do - are you sure this is a good idea?

Attachment: signature.asc
Description: PGP signature