From: Srinivas Kandagatla Date: Thu, 23 Oct 2025 10:24:41 +0000 (+0100) Subject: ASoC: qcom: q6afe: Use guard() for spin locks X-Git-Tag: v6.19-rc1~156^2~3^2~62^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4b1edbb028fb95b546893068b321a983b1ef50bc;p=thirdparty%2Fkernel%2Flinux.git ASoC: qcom: q6afe: Use guard() for spin locks Clean up the code using guard() for spin locks. No functional changes, just cleanup. Signed-off-by: Srinivas Kandagatla Link: https://patch.msgid.link/20251023102444.88158-18-srinivas.kandagatla@oss.qualcomm.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/qcom/qdsp6/q6afe.c b/sound/soc/qcom/qdsp6/q6afe.c index 56f85f1c24258..980851a129760 100644 --- a/sound/soc/qcom/qdsp6/q6afe.c +++ b/sound/soc/qcom/qdsp6/q6afe.c @@ -946,9 +946,8 @@ static struct q6afe_port *q6afe_find_port(struct q6afe *afe, int token) { struct q6afe_port *p; struct q6afe_port *ret = NULL; - unsigned long flags; - spin_lock_irqsave(&afe->port_list_lock, flags); + guard(spinlock)(&afe->port_list_lock); list_for_each_entry(p, &afe->port_list, node) if (p->token == token) { ret = p; @@ -956,7 +955,6 @@ static struct q6afe_port *q6afe_find_port(struct q6afe *afe, int token) break; } - spin_unlock_irqrestore(&afe->port_list_lock, flags); return ret; } @@ -1733,7 +1731,6 @@ struct q6afe_port *q6afe_port_get_from_id(struct device *dev, int id) int port_id; struct q6afe *afe = dev_get_drvdata(dev->parent); struct q6afe_port *port; - unsigned long flags; int cfg_type; if (id < 0 || id >= AFE_PORT_MAX) { @@ -1810,9 +1807,8 @@ struct q6afe_port *q6afe_port_get_from_id(struct device *dev, int id) port->cfg_type = cfg_type; kref_init(&port->refcount); - spin_lock_irqsave(&afe->port_list_lock, flags); + guard(spinlock)(&afe->port_list_lock); list_add_tail(&port->node, &afe->port_list); - spin_unlock_irqrestore(&afe->port_list_lock, flags); return port;