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 <srinivas.kandagatla@oss.qualcomm.com> Link: https://patch.msgid.link/20251023102444.88158-18-srinivas.kandagatla@oss.qualcomm.com Signed-off-by: Mark Brown <broonie@kernel.org>pull/1354/merge
parent
6e00112d31
commit
4b1edbb028
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue