Skip to contentSkip to conversation

ASoC: twl4030 - Fix build error

PATCH In review Joonyoung Shim 4 participants 6 messages Mar 16, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: twl4030 - Fix build error

CC sound/soc/codecs/twl4030.o
sound/soc/codecs/twl4030.c:1400: warning: braces around scalar initializer sound/soc/codecs/twl4030.c:1400: warning: (near initialization for 'twl4030_dai.ops')
sound/soc/codecs/twl4030.c:1401: error: field name not in record or union initializer
sound/soc/codecs/twl4030.c:1401: error: (near initialization for 'twl4030_dai.ops')
sound/soc/codecs/twl4030.c:1401: warning: initialization from incompatible pointer type
sound/soc/codecs/twl4030.c:1402: error: field name not in record or union initializer
sound/soc/codecs/twl4030.c:1402: error: (near initialization for 'twl4030_dai.ops')
sound/soc/codecs/twl4030.c:1402: warning: excess elements in scalar initializer sound/soc/codecs/twl4030.c:1402: warning: (near initialization for 'twl4030_dai.ops')
sound/soc/codecs/twl4030.c:1403: error: field name not in record or union initializer
sound/soc/codecs/twl4030.c:1403: error: (near initialization for 'twl4030_dai.ops')
sound/soc/codecs/twl4030.c:1403: warning: excess elements in scalar initializer sound/soc/codecs/twl4030.c:1403: warning: (near initialization for 'twl4030_dai.ops')

---
 sound/soc/codecs/twl4030.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
sound/soc/codecs/twl4030.c +0 -0
index ce4b43b..5ed5f1b 100644
@@ -1383,6 +1383,12 @@ static int twl4030_set_dai_fmt(struct

snd_soc_dai *codec_dai,
#define TWL4030_RATES (SNDRV_PCM_RATE_8000_48000)
#define TWL4030_FORMATS (SNDRV_PCM_FMTBIT_S16_LE |
SNDRV_PCM_FORMAT_S24_LE)

+static struct snd_soc_dai_ops twl4030_dai_ops = {

+       .hw_params      = twl4030_hw_params,
+       .set_sysclk     = twl4030_set_dai_sysclk,
+       .set_fmt        = twl4030_set_dai_fmt,
+};
+
 struct snd_soc_dai twl4030_dai = {
        .name = "twl4030",
        .playback = {
@@ -1397,11 +1403,7 @@ struct snd_soc_dai twl4030_dai = {
                .channels_max = 2,
                .rates = TWL4030_RATES,
                .formats = TWL4030_FORMATS,},
-       .ops = {
-               .hw_params = twl4030_hw_params,
-               .set_sysclk = twl4030_set_dai_sysclk,
-               .set_fmt = twl4030_set_dai_fmt,

- }
+ .ops = &twl4030_dai_ops,
};
EXPORT_SYMBOL_GPL(twl4030_dai);

Signature · 5 lines
1.5.6.3


-- 
- Joonyoung Shim
#1 lore raw
Quoted 29 lines
---
 sound/soc/codecs/twl4030.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
sound/soc/codecs/twl4030.c +6 -0
index ce4b43b..5ed5f1b 100644
@@ -1383,6 +1383,12 @@ static int twl4030_set_dai_fmt(struct
 snd_soc_dai *codec_dai,
 #define TWL4030_RATES   (SNDRV_PCM_RATE_8000_48000)
 #define TWL4030_FORMATS         (SNDRV_PCM_FMTBIT_S16_LE |
 SNDRV_PCM_FORMAT_S24_LE)
 
+static struct snd_soc_dai_ops twl4030_dai_ops = {
+       .hw_params      = twl4030_hw_params,
+       .set_sysclk     = twl4030_set_dai_sysclk,
+       .set_fmt        = twl4030_set_dai_fmt,
+};
+
 struct snd_soc_dai twl4030_dai = {
       .name = "twl4030",
       .playback = {
sound/soc/codecs/twl4030.c +0 -0
@@ -1397,11 +1403,7 @@ struct snd_soc_dai twl4030_dai = {
               .channels_max = 2,
               .rates = TWL4030_RATES,

sound/soc/codecs/twl4030.c struct snd_soc_dai twl4030_dai = { · line 1409

Quoted 10 lines
sound/soc/codecs/twl4030.c +1 -5
               .formats = TWL4030_FORMATS,},
-       .ops = {
-               .hw_params = twl4030_hw_params,
-               .set_sysclk = twl4030_set_dai_sysclk,
-               .set_fmt = twl4030_set_dai_fmt,
-       }
+       .ops = &twl4030_dai_ops,
 };
 EXPORT_SYMBOL_GPL(twl4030_dai);
 

Looks like a valid fix but note there is line wrapping and tabs are converted
into spaces so patch doesn't apply.

Jarkko

#2 lore raw

At Mon, 16 Mar 2009 09:01:11 +0200,

Quoted 35 lines · Jarkko Nikula
Quoted 35 lines
---
 sound/soc/codecs/twl4030.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
sound/soc/codecs/twl4030.c +6 -0
index ce4b43b..5ed5f1b 100644
@@ -1383,6 +1383,12 @@ static int twl4030_set_dai_fmt(struct
 snd_soc_dai *codec_dai,
 #define TWL4030_RATES   (SNDRV_PCM_RATE_8000_48000)
 #define TWL4030_FORMATS         (SNDRV_PCM_FMTBIT_S16_LE |
 SNDRV_PCM_FORMAT_S24_LE)
 
+static struct snd_soc_dai_ops twl4030_dai_ops = {
+       .hw_params      = twl4030_hw_params,
+       .set_sysclk     = twl4030_set_dai_sysclk,
+       .set_fmt        = twl4030_set_dai_fmt,
+};
+
 struct snd_soc_dai twl4030_dai = {
       .name = "twl4030",
       .playback = {
sound/soc/codecs/twl4030.c +0 -5
@@ -1397,11 +1403,7 @@ struct snd_soc_dai twl4030_dai = {
               .channels_max = 2,
               .rates = TWL4030_RATES,
               .formats = TWL4030_FORMATS,},
-       .ops = {
-               .hw_params = twl4030_hw_params,
-               .set_sysclk = twl4030_set_dai_sysclk,
-               .set_fmt = twl4030_set_dai_fmt,
-       }
Quoted 8 lines

sound/soc/codecs/twl4030.c struct snd_soc_dai twl4030_dai = { · line 1409

Quoted 5 lines
sound/soc/codecs/twl4030.c +1 -0
+       .ops = &twl4030_dai_ops,
 };
 EXPORT_SYMBOL_GPL(twl4030_dai);
 

Looks like a valid fix but note there is line wrapping and tabs are converted
into spaces so patch doesn't apply.

Right, please fix and repost.

Meanwhile, I found also sound/soc/sh/hac.c and sound/soc/s3c24xx/s3c64xx-i2s.c have the same problem.

Mark, care to fix them?

thanks,

Takashi

#3 lore raw

At Mon, 16 Mar 2009 09:35:24 +0100,

Quoted 47 lines · I wrote:

At Mon, 16 Mar 2009 09:01:11 +0200,

Quoted 35 lines · Jarkko Nikula
Quoted 35 lines
---
 sound/soc/codecs/twl4030.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
sound/soc/codecs/twl4030.c +6 -0
index ce4b43b..5ed5f1b 100644
@@ -1383,6 +1383,12 @@ static int twl4030_set_dai_fmt(struct
 snd_soc_dai *codec_dai,
 #define TWL4030_RATES   (SNDRV_PCM_RATE_8000_48000)
 #define TWL4030_FORMATS         (SNDRV_PCM_FMTBIT_S16_LE |
 SNDRV_PCM_FORMAT_S24_LE)
 
+static struct snd_soc_dai_ops twl4030_dai_ops = {
+       .hw_params      = twl4030_hw_params,
+       .set_sysclk     = twl4030_set_dai_sysclk,
+       .set_fmt        = twl4030_set_dai_fmt,
+};
+
 struct snd_soc_dai twl4030_dai = {
       .name = "twl4030",
       .playback = {
sound/soc/codecs/twl4030.c +0 -5
@@ -1397,11 +1403,7 @@ struct snd_soc_dai twl4030_dai = {
               .channels_max = 2,
               .rates = TWL4030_RATES,
               .formats = TWL4030_FORMATS,},
-       .ops = {
-               .hw_params = twl4030_hw_params,
-               .set_sysclk = twl4030_set_dai_sysclk,
-               .set_fmt = twl4030_set_dai_fmt,
-       }
Quoted 8 lines

sound/soc/codecs/twl4030.c struct snd_soc_dai twl4030_dai = { · line 1409

Quoted 5 lines
sound/soc/codecs/twl4030.c +1 -0
+       .ops = &twl4030_dai_ops,
 };
 EXPORT_SYMBOL_GPL(twl4030_dai);
 

Looks like a valid fix but note there is line wrapping and tabs are converted
into spaces so patch doesn't apply.

Quoted 6 lines

Right, please fix and repost.

Meanwhile, I found also sound/soc/sh/hac.c and sound/soc/s3c24xx/s3c64xx-i2s.c have the same problem.

Mark, care to fix them?

Also, pxa2xx-ac97.c gets the compile warnings below due to the commit
commit 6335d05548eece40092000aa91b64a50310d69d5
Author: Eric Miao <[email protected]>
ASoC: make ops a pointer in 'struct snd_soc_dai'

sound/soc/pxa/pxa2xx-ac97.c:136: warning: 'pxa2xx_ac97_hw_aux_params' defined but not used sound/soc/pxa/pxa2xx-ac97.c:151: warning: 'pxa2xx_ac97_hw_mic_params' defined but not used

The conversion in that commit looks incomplete. We'd need three different dai_ops.

Takashi

#4 lore raw
Quoted 5 lines · Takashi Iwai

sound/soc/pxa/pxa2xx-ac97.c:136: warning: 'pxa2xx_ac97_hw_aux_params' defined but not used sound/soc/pxa/pxa2xx-ac97.c:151: warning: 'pxa2xx_ac97_hw_mic_params' defined but not used

The conversion in that commit looks incomplete. We'd need three different dai_ops.

Yup, fixed that one too.

#5 lore raw
In reply to Takashi Iwai
Quoted 5 lines
Quoted 3 lines

Looks like a valid fix but note there is line wrapping and tabs are converted
into spaces so patch doesn't apply.

Right, please fix and repost.

Ok, i reposted.

Thanks

Signature · 1 line
- Joonyoung Shim