summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sound/hda/codecs/side-codecs/tas2781_hda_i2c.c10
-rw-r--r--sound/hda/codecs/side-codecs/tas2781_hda_spi.c7
2 files changed, 5 insertions, 12 deletions
diff --git a/sound/hda/codecs/side-codecs/tas2781_hda_i2c.c b/sound/hda/codecs/side-codecs/tas2781_hda_i2c.c
index c8619995b1d7..c74f83d4ec7f 100644
--- a/sound/hda/codecs/side-codecs/tas2781_hda_i2c.c
+++ b/sound/hda/codecs/side-codecs/tas2781_hda_i2c.c
@@ -500,8 +500,8 @@ static void tasdev_fw_ready(const struct firmware *fmw, void *context)
struct hda_codec *codec = tas_priv->codec;
int ret;
- pm_runtime_get_sync(tas_priv->dev);
- mutex_lock(&tas_priv->codec_lock);
+ guard(pm_runtime_active_auto)(tas_priv->dev);
+ guard(mutex)(&tas_priv->codec_lock);
ret = tasdevice_rca_parser(tas_priv, fmw);
if (ret)
@@ -537,9 +537,7 @@ static void tasdev_fw_ready(const struct firmware *fmw, void *context)
}
out:
- mutex_unlock(&tas_hda->priv->codec_lock);
release_firmware(fmw);
- pm_runtime_put_autosuspend(tas_hda->dev);
}
static int tas2781_hda_bind(struct device *dev, struct device *master,
@@ -571,7 +569,7 @@ static int tas2781_hda_bind(struct device *dev, struct device *master,
break;
}
- pm_runtime_get_sync(dev);
+ guard(pm_runtime_active_auto)(dev);
comp->dev = dev;
@@ -581,8 +579,6 @@ static int tas2781_hda_bind(struct device *dev, struct device *master,
if (!ret)
comp->playback_hook = tas2781_hda_playback_hook;
- pm_runtime_put_autosuspend(dev);
-
return ret;
}
diff --git a/sound/hda/codecs/side-codecs/tas2781_hda_spi.c b/sound/hda/codecs/side-codecs/tas2781_hda_spi.c
index b9a55672bf15..f8412c5df919 100644
--- a/sound/hda/codecs/side-codecs/tas2781_hda_spi.c
+++ b/sound/hda/codecs/side-codecs/tas2781_hda_spi.c
@@ -636,7 +636,7 @@ static void tasdev_fw_ready(const struct firmware *fmw, void *context)
struct hda_codec *codec = tas_priv->codec;
int ret, val;
- pm_runtime_get_sync(tas_priv->dev);
+ guard(pm_runtime_active_auto)(tas_priv->dev);
guard(mutex)(&tas_priv->codec_lock);
ret = tasdevice_rca_parser(tas_priv, fmw);
@@ -699,7 +699,6 @@ static void tasdev_fw_ready(const struct firmware *fmw, void *context)
tas2781_save_calibration(tas_hda);
out:
release_firmware(fmw);
- pm_runtime_put_autosuspend(tas_hda->priv->dev);
}
static int tas2781_hda_bind(struct device *dev, struct device *master,
@@ -720,7 +719,7 @@ static int tas2781_hda_bind(struct device *dev, struct device *master,
codec = parent->codec;
- pm_runtime_get_sync(dev);
+ guard(pm_runtime_active_auto)(dev);
comp->dev = dev;
@@ -731,8 +730,6 @@ static int tas2781_hda_bind(struct device *dev, struct device *master,
if (!ret)
comp->playback_hook = tas2781_hda_playback_hook;
- pm_runtime_put_autosuspend(dev);
-
return ret;
}