Skip to contentSkip to conversation

ASoC: Remove unused "control_data" field of struct ak4671_priv

PATCH Applied Axel Lin 3 participants 9 messages Sep 28, 2011 – Sep 29, 2011

Subsystems (3)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/6 ASoC: Remove unused "control_data" field of struct ak4671_priv

The control_data field is used to initialize the codec's control_data field, but since this is also done by the snd-soc-cache core, the redundant assignment can be removed and the field can be dropped.

---
 sound/soc/codecs/ak4671.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
sound/soc/codecs/ak4671.c +0 -2
index 88b29f8..2ecf128 100644
@@ -26,7 +26,6 @@
 /* codec private data */
 struct ak4671_priv {
 	enum snd_soc_control_type control_type;
-	void *control_data;
 };
 
 /* ak4671 register cache & default register settings */
@@ -675,7 +674,6 @@ static int __devinit ak4671_i2c_probe(struct i2c_client *client,
 		return -ENOMEM;
 
 	i2c_set_clientdata(client, ak4671);
-	ak4671->control_data = client;
 	ak4671->control_type = SND_SOC_I2C;
 
 	ret = snd_soc_register_codec(&client->dev,
Signature · 1 line
1.7.4.1
author
#1 lore raw

PATCH 2/6 ASoC: Remove unused "control_data" field of struct alc5623_priv

The control_data field is used to initialize the codec's control_data field, but since this is also done by the snd-soc-cache core, the redundant assignment can be removed and the field can be dropped.

---
 sound/soc/codecs/alc5623.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
sound/soc/codecs/alc5623.c +0 -2
index 0517315..557b3af 100644
@@ -40,7 +40,6 @@ MODULE_PARM_DESC(caps_charge, "ALC5623 cap charge time (msecs)");
 /* codec private data */
 struct alc5623_priv {
 	enum snd_soc_control_type control_type;
-	void *control_data;
 	u8 id;
 	unsigned int sysclk;
 	u16 reg_cache[ALC5623_VENDOR_ID2+2];
@@ -1049,7 +1048,6 @@ static int alc5623_i2c_probe(struct i2c_client *client,
 	}
 
 	i2c_set_clientdata(client, alc5623);
-	alc5623->control_data = client;
 	alc5623->control_type = SND_SOC_I2C;
 
 	ret =  snd_soc_register_codec(&client->dev,
Signature · 1 line
1.7.4.1
author
#2 lore raw

PATCH 3/6 ASoC: Remove unused "control_data" field of struct cs4270_private

In reply to Axel Lin

The control_data field is used to initialize the codec's control_data field, but since this is also done by the snd-soc-cache core, the redundant assignment can be removed and the field can be dropped.

---
 sound/soc/codecs/cs4270.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)
sound/soc/codecs/cs4270.c +1 -5
index 6cc8678..5830c93 100644
@@ -128,7 +128,6 @@ static const char *supply_names[] = {
 /* Private data for the CS4270 */
 struct cs4270_private {
 	enum snd_soc_control_type control_type;
-	void *control_data;
 	unsigned int mclk; /* Input frequency of the MCLK pin */
 	unsigned int mode; /* The mode (I2S or left-justified) */
 	unsigned int slave_mode;
@@ -490,8 +489,6 @@ static int cs4270_probe(struct snd_soc_codec *codec)
 	struct cs4270_private *cs4270 = snd_soc_codec_get_drvdata(codec);
 	int i, ret;
 
-	codec->control_data = cs4270->control_data;
-
 	/* Tell ASoC what kind of I/O to use to read the registers.  ASoC will
 	 * then do the I2C transactions itself.
 	 */
@@ -604,7 +601,7 @@ static int cs4270_soc_suspend(struct snd_soc_codec *codec, pm_message_t mesg)
 static int cs4270_soc_resume(struct snd_soc_codec *codec)
 {
 	struct cs4270_private *cs4270 = snd_soc_codec_get_drvdata(codec);
-	struct i2c_client *i2c_client = codec->control_data;
+	struct i2c_client *i2c_client = to_i2c_client(codec->dev);
 	int reg;
 
 	regulator_bulk_enable(ARRAY_SIZE(cs4270->supplies),
@@ -690,7 +687,6 @@ static int cs4270_i2c_probe(struct i2c_client *i2c_client,
 	}
 
 	i2c_set_clientdata(i2c_client, cs4270);
-	cs4270->control_data = i2c_client;
 	cs4270->control_type = SND_SOC_I2C;
 
 	ret = snd_soc_register_codec(&i2c_client->dev,
Signature · 1 line
1.7.4.1
Acked-by on v1 3/6
#3 lore raw

Re: [PATCH 3/6] ASoC: Remove unused "control_data" field of struct cs4270_private

Quoted 6 lines · Axel Lin

The control_data field is used to initialize the codec's control_data field, but since this is also done by the snd-soc-cache core, the redundant assignment can be removed and the field can be dropped.

---

Although Mark, it would have been nice if you had given me a chance to test this change before applying the patch.

Signature · 2 lines
Timur Tabi
Linux kernel developer at Freescale
#4 lore raw

Re: [PATCH 3/6] ASoC: Remove unused "control_data" field of struct cs4270_private

Quoted 2 lines · Timur Tabi

Although Mark, it would have been nice if you had given me a chance to test this change before applying the patch.

With this sort of repetitive change by Axel I'm often not really going to register which particular dirver he's fixing in a given patch - he's generally very good and one of the advantages of keeping all the drivers consistent is that it's easy to deploy subsystem wide changes.

author
#5 lore raw

PATCH 4/6 ASoC: Remove unused "control_data" field of struct cs42l51_private

In reply to Axel Lin

The control_data field is used to initialize the codec's control_data field, but since this is also done by the snd-soc-cache core, the redundant assignment can be removed and the field can be dropped.

---
 sound/soc/codecs/cs42l51.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)
sound/soc/codecs/cs42l51.c +1 -5
index 8fb7070..286878d 100644
@@ -42,7 +42,6 @@ enum master_slave_mode {
 
 struct cs42l51_private {
 	enum snd_soc_control_type control_type;
-	void *control_data;
 	unsigned int mclk;
 	unsigned int audio_mode;	/* The mode (I2S or left-justified) */
 	enum master_slave_mode func;
@@ -57,7 +56,7 @@ struct cs42l51_private {
 static int cs42l51_fill_cache(struct snd_soc_codec *codec)
 {
 	u8 *cache = codec->reg_cache + 1;
-	struct i2c_client *i2c_client = codec->control_data;
+	struct i2c_client *i2c_client = to_i2c_client(codec->dev);
 	s32 length;
 
 	length = i2c_smbus_read_i2c_block_data(i2c_client,
@@ -520,8 +519,6 @@ static int cs42l51_probe(struct snd_soc_codec *codec)
 	struct snd_soc_dapm_context *dapm = &codec->dapm;
 	int ret, reg;
 
-	codec->control_data = cs42l51->control_data;
-
 	ret = cs42l51_fill_cache(codec);
 	if (ret < 0) {
 		dev_err(codec->dev, "failed to fill register cache\n");
@@ -593,7 +590,6 @@ static int cs42l51_i2c_probe(struct i2c_client *i2c_client,
 	}
 
 	i2c_set_clientdata(i2c_client, cs42l51);
-	cs42l51->control_data = i2c_client;
 	cs42l51->control_type = SND_SOC_I2C;
 
 	ret =  snd_soc_register_codec(&i2c_client->dev,
Signature · 1 line
1.7.4.1
author
#6 lore raw

PATCH 5/6 ASoC: Remove unused "control_data" field of struct max98088_priv

In reply to Axel Lin

The control_data field is used to initialize the codec's control_data field, but since this is also done by the snd-soc-cache core, the redundant assignment can be removed and the field can be dropped.

---
 sound/soc/codecs/max98088.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
sound/soc/codecs/max98088.c +0 -2
index ac65a2d..587043b 100644
@@ -40,7 +40,6 @@ struct max98088_cdata {
 
 struct max98088_priv {
        enum max98088_type devtype;
-       void *control_data;
        struct max98088_pdata *pdata;
        unsigned int sysclk;
        struct max98088_cdata dai[2];
@@ -2066,7 +2065,6 @@ static int max98088_i2c_probe(struct i2c_client *i2c,
        max98088->devtype = id->driver_data;
 
        i2c_set_clientdata(i2c, max98088);
-       max98088->control_data = i2c;
        max98088->pdata = i2c->dev.platform_data;
 
        ret = snd_soc_register_codec(&i2c->dev,
Signature · 1 line
1.7.4.1
author
#7 lore raw

PATCH 6/6 ASoC: Remove unused "control_data" field of struct max98095_priv

In reply to Axel Lin

The control_data field is used to initialize the codec's control_data field, but since this is also done by the snd-soc-cache core, the redundant assignment can be removed and the field can be dropped.

---
 sound/soc/codecs/max98095.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
sound/soc/codecs/max98095.c +0 -2
index 668434d..8f8e255 100644
@@ -40,7 +40,6 @@ struct max98095_cdata {
 
 struct max98095_priv {
 	enum max98095_type devtype;
-	void *control_data;
 	struct max98095_pdata *pdata;
 	unsigned int sysclk;
 	struct max98095_cdata dai[3];
@@ -2337,7 +2336,6 @@ static int max98095_i2c_probe(struct i2c_client *i2c,
 
 	max98095->devtype = id->driver_data;
 	i2c_set_clientdata(i2c, max98095);
-	max98095->control_data = i2c;
 	max98095->pdata = i2c->dev.platform_data;
 
 	ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_max98095,
Signature · 1 line
1.7.4.1
Applied
#8 lore raw
In reply to Axel Lin
Quoted 3 lines · Axel Lin

The control_data field is used to initialize the codec's control_data field, but since this is also done by the snd-soc-cache core, the redundant assignment can be removed and the field can be dropped.

Applied all, thanks.