]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoc: qcom: q6afe: use guards consistently
authorJohan Hovold <johan@kernel.org>
Wed, 3 Dec 2025 10:55:42 +0000 (11:55 +0100)
committerMark Brown <broonie@kernel.org>
Sun, 14 Dec 2025 10:37:34 +0000 (19:37 +0900)
A recent change switched to using guards for the port list lock but only
modified two out of three functions where the lock is held.

Convert also the third function for consistency while switching to a
scoped guard in q6afe_port_get_from_id() for clarity.

Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20251203105542.24765-3-johan@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/qcom/qdsp6/q6afe.c

index 0b01fc9e13a7278ff11567bc4e7f14ae65c60d91..d8173cd9e60a9c8815d125657bc206fb97593e17 100644 (file)
@@ -931,13 +931,11 @@ static void q6afe_port_free(struct kref *ref)
 {
        struct q6afe_port *port;
        struct q6afe *afe;
-       unsigned long flags;
 
        port = container_of(ref, struct q6afe_port, refcount);
        afe = port->afe;
-       spin_lock_irqsave(&afe->port_list_lock, flags);
-       list_del(&port->node);
-       spin_unlock_irqrestore(&afe->port_list_lock, flags);
+       scoped_guard(spinlock_irqsave, &afe->port_list_lock)
+               list_del(&port->node);
        kfree(port->scfg);
        kfree(port);
 }
@@ -1807,8 +1805,8 @@ struct q6afe_port *q6afe_port_get_from_id(struct device *dev, int id)
        port->cfg_type = cfg_type;
        kref_init(&port->refcount);
 
-       guard(spinlock_irqsave)(&afe->port_list_lock);
-       list_add_tail(&port->node, &afe->port_list);
+       scoped_guard(spinlock_irqsave, &afe->port_list_lock)
+               list_add_tail(&port->node, &afe->port_list);
 
        return port;