[alsa-devel] [PATCH 0/6] ASoC: Remove unused control_data field from private struct
This serial removes unused control_data field from private struct. 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.
Note: I don't have these hardware, only compile test on these patches.
Axel Lin (6): ASoC: Remove unused "control_data" field of struct wm8904_priv ASoC: Remove unused "control_data" field of struct wm8940_priv ASoC: Remove unused "control_data" field of struct wm8960_priv ASoC: Remove unused "control_data" field of struct wm8978_priv ASoC: Remove unused "control_data" field of struct wm9081_priv ASoC: Remove unused "control_data" field of struct wm9090_priv
sound/soc/codecs/wm8904.c | 2 -- sound/soc/codecs/wm8940.c | 3 --- sound/soc/codecs/wm8960.c | 3 --- sound/soc/codecs/wm8978.c | 3 --- sound/soc/codecs/wm9081.c | 3 --- sound/soc/codecs/wm9090.c | 3 --- 6 files changed, 0 insertions(+), 17 deletions(-)
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.
Signed-off-by: Axel Lin axel.lin@gmail.com --- sound/soc/codecs/wm8904.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c index b085575..9fc8f4c 100644 --- a/sound/soc/codecs/wm8904.c +++ b/sound/soc/codecs/wm8904.c @@ -50,7 +50,6 @@ static const char *wm8904_supply_names[WM8904_NUM_SUPPLIES] = { struct wm8904_priv {
enum wm8904_type devtype; - void *control_data;
struct regulator_bulk_data supplies[WM8904_NUM_SUPPLIES];
@@ -2540,7 +2539,6 @@ static __devinit int wm8904_i2c_probe(struct i2c_client *i2c,
wm8904->devtype = id->driver_data; i2c_set_clientdata(i2c, wm8904); - wm8904->control_data = i2c; wm8904->pdata = i2c->dev.platform_data;
ret = snd_soc_register_codec(&i2c->dev,
On Tue, Sep 27, 2011 at 08:40:22PM +0800, Axel Lin wrote:
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.
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.
Signed-off-by: Axel Lin axel.lin@gmail.com --- sound/soc/codecs/wm8940.c | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/sound/soc/codecs/wm8940.c b/sound/soc/codecs/wm8940.c index 056daa0..7e0f54c 100644 --- a/sound/soc/codecs/wm8940.c +++ b/sound/soc/codecs/wm8940.c @@ -43,7 +43,6 @@ struct wm8940_priv { unsigned int sysclk; enum snd_soc_control_type control_type; - void *control_data; };
static u16 wm8940_reg_defaults[] = { @@ -693,7 +692,6 @@ static int wm8940_probe(struct snd_soc_codec *codec) int ret; u16 reg;
- codec->control_data = wm8940->control_data; ret = snd_soc_codec_set_cache_io(codec, 8, 16, wm8940->control_type); if (ret < 0) { dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret); @@ -758,7 +756,6 @@ static __devinit int wm8940_i2c_probe(struct i2c_client *i2c, return -ENOMEM;
i2c_set_clientdata(i2c, wm8940); - wm8940->control_data = i2c; wm8940->control_type = SND_SOC_I2C;
ret = snd_soc_register_codec(&i2c->dev,
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.
Signed-off-by: Axel Lin axel.lin@gmail.com --- sound/soc/codecs/wm8960.c | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c index 4393394..831c20f 100644 --- a/sound/soc/codecs/wm8960.c +++ b/sound/soc/codecs/wm8960.c @@ -72,7 +72,6 @@ static const u16 wm8960_reg[WM8960_CACHEREGNUM] = {
struct wm8960_priv { enum snd_soc_control_type control_type; - void *control_data; int (*set_bias_level)(struct snd_soc_codec *, enum snd_soc_bias_level level); struct snd_soc_dapm_widget *lout1; @@ -925,7 +924,6 @@ static int wm8960_probe(struct snd_soc_codec *codec) u16 reg;
wm8960->set_bias_level = wm8960_set_bias_level_out3; - codec->control_data = wm8960->control_data;
if (!pdata) { dev_warn(codec->dev, "No platform data supplied\n"); @@ -1015,7 +1013,6 @@ static __devinit int wm8960_i2c_probe(struct i2c_client *i2c,
i2c_set_clientdata(i2c, wm8960); wm8960->control_type = SND_SOC_I2C; - wm8960->control_data = i2c;
ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_wm8960, &wm8960_dai, 1);
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.
Signed-off-by: Axel Lin axel.lin@gmail.com --- sound/soc/codecs/wm8978.c | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/sound/soc/codecs/wm8978.c b/sound/soc/codecs/wm8978.c index 85e3e63..41ca4d9 100644 --- a/sound/soc/codecs/wm8978.c +++ b/sound/soc/codecs/wm8978.c @@ -52,7 +52,6 @@ static const u16 wm8978_reg[WM8978_CACHEREGNUM] = { /* codec private data */ struct wm8978_priv { enum snd_soc_control_type control_type; - void *control_data; unsigned int f_pllout; unsigned int f_mclk; unsigned int f_256fs; @@ -955,7 +954,6 @@ static int wm8978_probe(struct snd_soc_codec *codec) * default hardware setting */ wm8978->sysclk = WM8978_PLL; - codec->control_data = wm8978->control_data; ret = snd_soc_codec_set_cache_io(codec, 7, 9, SND_SOC_I2C); if (ret < 0) { dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret); @@ -1016,7 +1014,6 @@ static __devinit int wm8978_i2c_probe(struct i2c_client *i2c, return -ENOMEM;
i2c_set_clientdata(i2c, wm8978); - wm8978->control_data = i2c;
ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_wm8978, &wm8978_dai, 1);
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.
Signed-off-by: Axel Lin axel.lin@gmail.com --- sound/soc/codecs/wm9081.c | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/sound/soc/codecs/wm9081.c b/sound/soc/codecs/wm9081.c index f32ab1e..b2d3448 100644 --- a/sound/soc/codecs/wm9081.c +++ b/sound/soc/codecs/wm9081.c @@ -157,7 +157,6 @@ static struct {
struct wm9081_priv { enum snd_soc_control_type control_type; - void *control_data; int sysclk_source; int mclk_rate; int sysclk_rate; @@ -1213,7 +1212,6 @@ static int wm9081_probe(struct snd_soc_codec *codec) int ret; u16 reg;
- codec->control_data = wm9081->control_data; ret = snd_soc_codec_set_cache_io(codec, 8, 16, wm9081->control_type); if (ret != 0) { dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret); @@ -1330,7 +1328,6 @@ static __devinit int wm9081_i2c_probe(struct i2c_client *i2c,
i2c_set_clientdata(i2c, wm9081); wm9081->control_type = SND_SOC_I2C; - wm9081->control_data = i2c;
if (dev_get_platdata(&i2c->dev)) memcpy(&wm9081->pdata, dev_get_platdata(&i2c->dev),
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.
Signed-off-by: Axel Lin axel.lin@gmail.com --- sound/soc/codecs/wm9090.c | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/sound/soc/codecs/wm9090.c b/sound/soc/codecs/wm9090.c index f2f3077..5f4786c 100644 --- a/sound/soc/codecs/wm9090.c +++ b/sound/soc/codecs/wm9090.c @@ -140,7 +140,6 @@ static const u16 wm9090_reg_defaults[] = { /* This struct is used to save the context */ struct wm9090_priv { struct wm9090_platform_data pdata; - void *control_data; };
static int wm9090_volatile(struct snd_soc_codec *codec, unsigned int reg) @@ -552,7 +551,6 @@ static int wm9090_probe(struct snd_soc_codec *codec) struct wm9090_priv *wm9090 = snd_soc_codec_get_drvdata(codec); int ret;
- codec->control_data = wm9090->control_data; ret = snd_soc_codec_set_cache_io(codec, 8, 16, SND_SOC_I2C); if (ret != 0) { dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret); @@ -661,7 +659,6 @@ static int wm9090_i2c_probe(struct i2c_client *i2c, sizeof(wm9090->pdata));
i2c_set_clientdata(i2c, wm9090); - wm9090->control_data = i2c;
ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_wm9090, NULL, 0);
participants (2)
-
Axel Lin
-
Mark Brown