Skip to contentSkip to conversation

ASoC: ssm2602: Do not dereference codec->control_data

PATCH Applied Lars-Peter Clausen 3 participants 3 messages Sep 20, 2011

Subsystems (3)
lore
Share & tools
lore

Lars-Peter Clausen

author maintainer
#0 lore raw

PATCH 1/1 ASoC: ssm2602: Do not dereference codec->control_data

The driver assumes that control_data points to the drivers i2c_client struct, but this is no longer the case since the ASoC core has switched to regmap.

---
 sound/soc/codecs/ssm2602.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
sound/soc/codecs/ssm2602.c +1 -2
index 84f4ad5..cceb002 100644
@@ -294,7 +294,6 @@ static int ssm2602_startup(struct snd_pcm_substream *substream,
 	struct snd_soc_pcm_runtime *rtd = substream->private_data;
 	struct snd_soc_codec *codec = rtd->codec;
 	struct ssm2602_priv *ssm2602 = snd_soc_codec_get_drvdata(codec);
-	struct i2c_client *i2c = codec->control_data;
 	struct snd_pcm_runtime *master_runtime;
 
 	/* The DAI has shared clocks so if we already have a playback or
@@ -303,7 +302,7 @@ static int ssm2602_startup(struct snd_pcm_substream *substream,
 	 */
 	if (ssm2602->master_substream) {
 		master_runtime = ssm2602->master_substream->runtime;
-		dev_dbg(&i2c->dev, "Constraining to %d bits at %dHz\n",
+		dev_dbg(codec->dev, "Constraining to %d bits at %dHz\n",
 			master_runtime->sample_bits,
 			master_runtime->rate);
 
Signature · 1 line
1.7.2.5
Acked-by on v1 1/1
#1 lore raw
Quoted 21 lines · Lars-Peter Clausen

The driver assumes that control_data points to the drivers i2c_client struct, but this is no longer the case since the ASoC core has switched to regmap.

---
 sound/soc/codecs/ssm2602.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
sound/soc/codecs/ssm2602.c +0 -1
index 84f4ad5..cceb002 100644
@@ -294,7 +294,6 @@ static int ssm2602_startup(struct snd_pcm_substream *substream,
 	struct snd_soc_pcm_runtime *rtd = substream->private_data;
 	struct snd_soc_codec *codec = rtd->codec;
 	struct ssm2602_priv *ssm2602 = snd_soc_codec_get_drvdata(codec);
-	struct i2c_client *i2c = codec->control_data;
 	struct snd_pcm_runtime *master_runtime;
 
 	/* The DAI has shared clocks so if we already have a playback or

sound/soc/codecs/ssm2602.c static int ssm2602_startup(struct snd_pcm_substream *substream, · line 308

Quoted 8 lines
sound/soc/codecs/ssm2602.c +1 -1
@@ -303,7 +302,7 @@ static int ssm2602_startup(struct snd_pcm_substream *substream,
 	 */
 	if (ssm2602->master_substream) {
 		master_runtime = ssm2602->master_substream->runtime;
-		dev_dbg(&i2c->dev, "Constraining to %d bits at %dHz\n",
+		dev_dbg(codec->dev, "Constraining to %d bits at %dHz\n",
 			master_runtime->sample_bits,
 			master_runtime->rate);
 
Applied
#2 lore raw
In reply to Lars-Peter Clausen
Quoted 2 lines · Lars-Peter Clausen

The driver assumes that control_data points to the drivers i2c_client struct, but this is no longer the case since the ASoC core has switched to regmap.

Applied, thanks.