[alsa-devel] Applied "ASoC: soc-io: Fix snd_soc_component_update_bits_legacy" to the asoc tree

Mark Brown broonie at kernel.org
Mon Mar 12 18:01:25 CET 2018


The patch

   ASoC: soc-io: Fix snd_soc_component_update_bits_legacy

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From dead99e8579b6e2ebdf1e9c819e67d7f4a5cedbb Mon Sep 17 00:00:00 2001
From: Peter Ujfalusi <peter.ujfalusi at ti.com>
Date: Mon, 12 Mar 2018 16:24:23 +0200
Subject: [PATCH] ASoC: soc-io: Fix snd_soc_component_update_bits_legacy

After the codec to component conversion codecs with custom read/write
function will no longer able to use update_bits as their io callbacks are
registered at component->driver level and not in component level.

To not complicate the code further, lets just use the
snd_soc_component_read/snd_soc_component_write function and let them sort
out the correct io function to call.

Fixes: d0ff8ba57d965 ("ASoC: add Component level .read/.write")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi at ti.com>
Signed-off-by: Mark Brown <broonie at kernel.org>
---
 sound/soc/soc-io.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/sound/soc/soc-io.c b/sound/soc/soc-io.c
index 2bc1c4c17896..d36a192fbece 100644
--- a/sound/soc/soc-io.c
+++ b/sound/soc/soc-io.c
@@ -88,19 +88,16 @@ static int snd_soc_component_update_bits_legacy(
 	unsigned int old, new;
 	int ret;
 
-	if (!component->read || !component->write)
-		return -EIO;
-
 	mutex_lock(&component->io_mutex);
 
-	ret = component->read(component, reg, &old);
+	ret = snd_soc_component_read(component, reg, &old);
 	if (ret < 0)
 		goto out_unlock;
 
 	new = (old & ~mask) | (val & mask);
 	*change = old != new;
 	if (*change)
-		ret = component->write(component, reg, new);
+		ret = snd_soc_component_write(component, reg, new);
 out_unlock:
 	mutex_unlock(&component->io_mutex);
 
-- 
2.16.2



More information about the Alsa-devel mailing list