Thread (55 messages) 55 messages, 2 authors, 2012-07-26

[PATCH 07/21] ASoC: io: Prevent use of regmap if request fails

flat view

From: Mark Brown <hidden>
Date: 2012-07-26 11:32:09
Also in: alsa-devel, lkml

On Thu, Jul 26, 2012 at 11:28:40AM +0100, Lee Jones wrote:
quoted hunk ↗ jump to hunk
@@ -52,10 +52,13 @@ static unsigned int hw_read(struct snd_soc_codec *codec, unsigned int reg)
 		if (codec->cache_only)
 			return -1;
 
-		ret = regmap_read(codec->control_data, reg, &val);
-		if (ret == 0)
-			return val;
-		else
+		if (codec->using_regmap) {
+			ret = regmap_read(codec->control_data, reg, &val);
+			if (ret == 0)
+				return val;
+			else
+				return -1;
+		} else
No, this makes no sense.  There is no non-regmap I/O support in soc-io,
anything using the soc-io hw_read() function must be using regmap.
quoted hunk ↗ jump to hunk
 	case SND_SOC_REGMAP:
 		/* Device has made its own regmap arrangements */
-		codec->using_regmap = true;
Again, this makes no sense.  If we're explicitly being asked to use
regmap then we should be using regmap or just failing to set up I/O
(which is obviously a catastrophic failure).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120726/3197f7ea/attachment.sig>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help