summaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-io.c
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2018-03-12 10:24:23 -0400
committerMark Brown <broonie@kernel.org>2018-03-12 12:58:02 -0400
commitdead99e8579b6e2ebdf1e9c819e67d7f4a5cedbb (patch)
tree09f1a2a3f379642c6efe3182055fec3612765e37 /sound/soc/soc-io.c
parent7928b2cbe55b2a410a0f5c1f154610059c57b1b2 (diff)
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@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-io.c')
-rw-r--r--sound/soc/soc-io.c7
1 files 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(
88 unsigned int old, new; 88 unsigned int old, new;
89 int ret; 89 int ret;
90 90
91 if (!component->read || !component->write)
92 return -EIO;
93
94 mutex_lock(&component->io_mutex); 91 mutex_lock(&component->io_mutex);
95 92
96 ret = component->read(component, reg, &old); 93 ret = snd_soc_component_read(component, reg, &old);
97 if (ret < 0) 94 if (ret < 0)
98 goto out_unlock; 95 goto out_unlock;
99 96
100 new = (old & ~mask) | (val & mask); 97 new = (old & ~mask) | (val & mask);
101 *change = old != new; 98 *change = old != new;
102 if (*change) 99 if (*change)
103 ret = component->write(component, reg, new); 100 ret = snd_soc_component_write(component, reg, new);
104out_unlock: 101out_unlock:
105 mutex_unlock(&component->io_mutex); 102 mutex_unlock(&component->io_mutex);
106 103