mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-12-05 02:50:56 -06:00
ASoC: codecs: rt700: Use guard() for mutex locks
Clean up the code using guard() for mutex locks. Merely code refactoring, and no behavior change. Signed-off-by: bui duc phuc <phucduc.bui@gmail.com> Link: https://patch.msgid.link/20260721102600.523199-24-phucduc.bui@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
//
|
||||
//
|
||||
|
||||
#include <linux/cleanup.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/soundwire/sdw.h>
|
||||
@@ -415,12 +416,11 @@ static int rt700_interrupt_callback(struct sdw_slave *slave,
|
||||
dev_dbg(&slave->dev,
|
||||
"%s control_port_stat=%x", __func__, status->control_port);
|
||||
|
||||
mutex_lock(&rt700->disable_irq_lock);
|
||||
guard(mutex)(&rt700->disable_irq_lock);
|
||||
if (status->control_port & 0x4 && !rt700->disable_irq) {
|
||||
mod_delayed_work(system_power_efficient_wq,
|
||||
&rt700->jack_detect_work, msecs_to_jiffies(250));
|
||||
}
|
||||
mutex_unlock(&rt700->disable_irq_lock);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -499,11 +499,11 @@ static int rt700_dev_system_suspend(struct device *dev)
|
||||
* deferred work completes and before the parent disables
|
||||
* interrupts on the link
|
||||
*/
|
||||
mutex_lock(&rt700->disable_irq_lock);
|
||||
rt700->disable_irq = true;
|
||||
ret = sdw_update_no_pm(slave, SDW_SCP_INTMASK1,
|
||||
SDW_SCP_INT1_IMPL_DEF, 0);
|
||||
mutex_unlock(&rt700->disable_irq_lock);
|
||||
scoped_guard(mutex, &rt700->disable_irq_lock) {
|
||||
rt700->disable_irq = true;
|
||||
ret = sdw_update_no_pm(slave, SDW_SCP_INTMASK1,
|
||||
SDW_SCP_INT1_IMPL_DEF, 0);
|
||||
}
|
||||
|
||||
if (ret < 0) {
|
||||
/* log but don't prevent suspend from happening */
|
||||
|
||||
Reference in New Issue
Block a user