[05/13] ASoC: Drop ASoC level caching from hw_write/hw_read
diff mbox

Message ID 1395129736-11938-6-git-send-email-lars@metafoo.de
State New, archived
Headers show

Commit Message

Lars-Peter Clausen March 18, 2014, 8:02 a.m. UTC
All drivers using these functions now do regmap level caching. So this is dead
code and can be removed.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 sound/soc/soc-io.c | 34 +++-------------------------------
 1 file changed, 3 insertions(+), 31 deletions(-)

Comments

Mark Brown March 19, 2014, 12:58 p.m. UTC | #1
On Tue, Mar 18, 2014 at 09:02:08AM +0100, Lars-Peter Clausen wrote:
> All drivers using these functions now do regmap level caching. So this is dead
> code and can be removed.

I actually have a version of this in my tree already, a cleaned up
version of the patch I posted while I was travelling which I couldn't
test at the time.  Since this one seems to depend on other stuff in your
series which I don't want to apply before the merge window I'm thinking
applying the version I have already - OK?
Lars-Peter Clausen March 19, 2014, 1:01 p.m. UTC | #2
On 03/19/2014 01:58 PM, Mark Brown wrote:
> On Tue, Mar 18, 2014 at 09:02:08AM +0100, Lars-Peter Clausen wrote:
>> All drivers using these functions now do regmap level caching. So this is dead
>> code and can be removed.
>
> I actually have a version of this in my tree already, a cleaned up
> version of the patch I posted while I was travelling which I couldn't
> test at the time.  Since this one seems to depend on other stuff in your
> series which I don't want to apply before the merge window I'm thinking
> applying the version I have already - OK?
>

yep.

Patch
diff mbox

diff --git a/sound/soc/soc-io.c b/sound/soc/soc-io.c
index de1e496..a66bc17 100644
--- a/sound/soc/soc-io.c
+++ b/sound/soc/soc-io.c
@@ -167,44 +167,16 @@  EXPORT_SYMBOL_GPL(snd_soc_platform_write);
 static int hw_write(struct snd_soc_codec *codec, unsigned int reg,
 		    unsigned int value)
 {
-	int ret;
-
-	if (!snd_soc_codec_volatile_register(codec, reg) &&
-	    reg < codec->driver->reg_cache_size &&
-	    !codec->cache_bypass) {
-		ret = snd_soc_cache_write(codec, reg, value);
-		if (ret < 0)
-			return -1;
-	}
-
-	if (codec->cache_only) {
-		codec->cache_sync = 1;
-		return 0;
-	}
-
 	return regmap_write(codec->control_data, reg, value);
 }
 
 static unsigned int hw_read(struct snd_soc_codec *codec, unsigned int reg)
 {
-	int ret;
 	unsigned int val;
+	int ret;
 
-	if (reg >= codec->driver->reg_cache_size ||
-	    snd_soc_codec_volatile_register(codec, reg) ||
-	    codec->cache_bypass) {
-		if (codec->cache_only)
-			return -1;
-
-		ret = regmap_read(codec->control_data, reg, &val);
-		if (ret == 0)
-			return val;
-		else
-			return -1;
-	}
-
-	ret = snd_soc_cache_read(codec, reg, &val);
-	if (ret < 0)
+	ret = regmap_read(codec->control_data, reg, &val);
+	if (ret != 0)
 		return -1;
 	return val;
 }