[PATCH v2 2/2] ASoC: meson: gx-formatter: add lockdep_assert_held check

From: Valerio Setti

Date: Wed Nov 11 2026 - 05:15:32 EST


The documentation of 'struct gx_formatter_ops' states that
formatter's callbacks for enable/disable/prepare are called with the
spinlock held. Validate this by adding 'lockdep_assert_held()' in
'gx_formatter_enable'/'gx_formatter_disable'.

Suggested-by: Martin Blumenstingl <martin.blumenstingl@xxxxxxxxxxxxxx>
Signed-off-by: Valerio Setti <vsetti@xxxxxxxxxxxx>
---
sound/soc/meson/gx-formatter.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/sound/soc/meson/gx-formatter.c b/sound/soc/meson/gx-formatter.c
index d3bc0c6c81cd..46efe34e84e1 100644
--- a/sound/soc/meson/gx-formatter.c
+++ b/sound/soc/meson/gx-formatter.c
@@ -22,6 +22,8 @@ static int gx_formatter_enable(struct gx_formatter *formatter)
{
int ret;

+ lockdep_assert_held(&formatter->stream->lock);
+
/* Do nothing if the formatter is already enabled */
if (formatter->enabled)
return 0;
@@ -46,6 +48,8 @@ static int gx_formatter_enable(struct gx_formatter *formatter)

static void gx_formatter_disable(struct gx_formatter *formatter)
{
+ lockdep_assert_held(&formatter->stream->lock);
+
/* Do nothing if the formatter is already disabled */
if (!formatter->enabled)
return;

--
2.47.3