mirror of
https://github.com/torvalds/linux.git
synced 2026-10-12 21:31:03 +02:00
ASoC: codecs: rt5668: 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-21-phucduc.bui@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
f1c5806947
commit
c745a4e595
|
|
@ -6,6 +6,7 @@
|
|||
* Author: Bard Liao <bardliao@realtek.com>
|
||||
*/
|
||||
|
||||
#include <linux/cleanup.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/moduleparam.h>
|
||||
#include <linux/init.h>
|
||||
|
|
@ -986,7 +987,7 @@ static void rt5668_jack_detect_handler(struct work_struct *work)
|
|||
return;
|
||||
}
|
||||
|
||||
mutex_lock(&rt5668->calibrate_mutex);
|
||||
guard(mutex)(&rt5668->calibrate_mutex);
|
||||
|
||||
val = snd_soc_component_read(rt5668->component, RT5668_AJD1_CTRL)
|
||||
& RT5668_JDH_RS_MASK;
|
||||
|
|
@ -1053,8 +1054,6 @@ static void rt5668_jack_detect_handler(struct work_struct *work)
|
|||
schedule_delayed_work(&rt5668->jd_check_work, 0);
|
||||
else
|
||||
cancel_delayed_work_sync(&rt5668->jd_check_work);
|
||||
|
||||
mutex_unlock(&rt5668->calibrate_mutex);
|
||||
}
|
||||
|
||||
static const struct snd_kcontrol_new rt5668_snd_controls[] = {
|
||||
|
|
@ -2356,7 +2355,7 @@ static void rt5668_calibrate(struct rt5668_priv *rt5668)
|
|||
{
|
||||
int value, count;
|
||||
|
||||
mutex_lock(&rt5668->calibrate_mutex);
|
||||
guard(mutex)(&rt5668->calibrate_mutex);
|
||||
|
||||
rt5668_reset(rt5668->regmap);
|
||||
regmap_write(rt5668->regmap, RT5668_PWR_ANLG_1, 0xa2bf);
|
||||
|
|
@ -2400,9 +2399,6 @@ static void rt5668_calibrate(struct rt5668_priv *rt5668)
|
|||
/* restore settings */
|
||||
regmap_write(rt5668->regmap, RT5668_STO1_ADC_MIXER, 0xc0c4);
|
||||
regmap_write(rt5668->regmap, RT5668_PWR_DIG_1, 0x0000);
|
||||
|
||||
mutex_unlock(&rt5668->calibrate_mutex);
|
||||
|
||||
}
|
||||
|
||||
static int rt5668_i2c_probe(struct i2c_client *i2c)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user