X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=sound%2Fsoc%2Fcodecs%2Fac97.c;h=2a1ffe39690887efcd9e5ea66628fca8e8d4d531;hb=02539d71fa98d5737bb668b02286c76241e4bac9;hp=55bc55eb6e24a925f1db81869db3989cebee9ed7;hpb=d9bc125caf592b7d081021f32ce5b717efdf70c8;p=linux-2.6 diff --git a/sound/soc/codecs/ac97.c b/sound/soc/codecs/ac97.c index 55bc55eb6e..2a1ffe3969 100644 --- a/sound/soc/codecs/ac97.c +++ b/sound/soc/codecs/ac97.c @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include @@ -41,10 +40,12 @@ static int ac97_prepare(struct snd_pcm_substream *substream) } #define STD_AC97_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 |\ - SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000) + SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 |\ + SNDRV_PCM_RATE_48000) -static struct snd_soc_codec_dai ac97_dai = { +struct snd_soc_codec_dai ac97_dai = { .name = "AC97 HiFi", + .type = SND_SOC_DAI_AC97, .playback = { .stream_name = "AC97 Playback", .channels_min = 1, @@ -60,6 +61,7 @@ static struct snd_soc_codec_dai ac97_dai = { .ops = { .prepare = ac97_prepare,}, }; +EXPORT_SYMBOL_GPL(ac97_dai); static unsigned int ac97_read(struct snd_soc_codec *codec, unsigned int reg) @@ -85,7 +87,7 @@ static int ac97_soc_probe(struct platform_device *pdev) printk(KERN_INFO "AC97 SoC Audio Codec %s\n", AC97_VERSION); socdev->codec = kzalloc(sizeof(struct snd_soc_codec), GFP_KERNEL); - if (socdev->codec == NULL) + if (!socdev->codec) return -ENOMEM; codec = socdev->codec; mutex_init(&codec->mutex); @@ -101,17 +103,17 @@ static int ac97_soc_probe(struct platform_device *pdev) /* register pcms */ ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1); - if(ret < 0) + if (ret < 0) goto err; /* add codec as bus device for standard ac97 */ ret = snd_ac97_bus(codec->card, 0, &soc_ac97_ops, NULL, &ac97_bus); - if(ret < 0) + if (ret < 0) goto bus_err; memset(&ac97_template, 0, sizeof(struct snd_ac97_template)); ret = snd_ac97_mixer(ac97_bus, &ac97_template, &codec->ac97); - if(ret < 0) + if (ret < 0) goto bus_err; ret = snd_soc_register_card(socdev); @@ -134,7 +136,7 @@ static int ac97_soc_remove(struct platform_device *pdev) struct snd_soc_device *socdev = platform_get_drvdata(pdev); struct snd_soc_codec *codec = socdev->codec; - if(codec == NULL) + if (!codec) return 0; snd_soc_free_pcms(socdev); @@ -144,11 +146,10 @@ static int ac97_soc_remove(struct platform_device *pdev) return 0; } -struct snd_soc_codec_device soc_codec_dev_ac97= { +struct snd_soc_codec_device soc_codec_dev_ac97 = { .probe = ac97_soc_probe, .remove = ac97_soc_remove, }; - EXPORT_SYMBOL_GPL(soc_codec_dev_ac97); MODULE_DESCRIPTION("Soc Generic AC97 driver");