X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=sound%2Fsoc%2Fnuc900%2Fnuc900-ac97.c;h=293dc748797c51cf11a63b6b0afa548521ff2898;hb=caa4a59574a39e6574664e82b92455d41eca27a8;hp=caa7c901bc2e131a24fbfe90e442242ab2e22185;hpb=b618f6f885579a6237e5bf4582fa6167972ddef4;p=mv-sheeva.git diff --git a/sound/soc/nuc900/nuc900-ac97.c b/sound/soc/nuc900/nuc900-ac97.c index caa7c901bc2..dac6732da96 100644 --- a/sound/soc/nuc900/nuc900-ac97.c +++ b/sound/soc/nuc900/nuc900-ac97.c @@ -20,7 +20,6 @@ #include #include #include -#include #include #include @@ -50,7 +49,7 @@ static unsigned short nuc900_ac97_read(struct snd_ac97 *ac97, mutex_lock(&ac97_mutex); val = nuc900_checkready(); - if (!!val) { + if (val) { dev_err(nuc900_audio->dev, "AC97 codec is not ready\n"); goto out; } @@ -103,7 +102,7 @@ static void nuc900_ac97_write(struct snd_ac97 *ac97, unsigned short reg, mutex_lock(&ac97_mutex); tmp = nuc900_checkready(); - if (!!tmp) + if (tmp) dev_err(nuc900_audio->dev, "AC97 codec is not ready\n"); /* clear the R_WB bit and write register index */ @@ -150,7 +149,7 @@ static void nuc900_ac97_warm_reset(struct snd_ac97 *ac97) udelay(100); val = nuc900_checkready(); - if (!!val) + if (val) dev_err(nuc900_audio->dev, "AC97 codec is not ready\n"); mutex_unlock(&ac97_mutex); @@ -264,8 +263,7 @@ static int nuc900_ac97_trigger(struct snd_pcm_substream *substream, return ret; } -static int nuc900_ac97_probe(struct platform_device *pdev, - struct snd_soc_dai *dai) +static int nuc900_ac97_probe(struct snd_soc_dai *dai) { struct nuc900_audio *nuc900_audio = nuc900_ac97_data; unsigned long val; @@ -285,20 +283,19 @@ static int nuc900_ac97_probe(struct platform_device *pdev, return 0; } -static void nuc900_ac97_remove(struct platform_device *pdev, - struct snd_soc_dai *dai) +static int nuc900_ac97_remove(struct snd_soc_dai *dai) { struct nuc900_audio *nuc900_audio = nuc900_ac97_data; clk_disable(nuc900_audio->clk); + return 0; } static struct snd_soc_dai_ops nuc900_ac97_dai_ops = { .trigger = nuc900_ac97_trigger, }; -struct snd_soc_dai nuc900_ac97_dai = { - .name = "nuc900-ac97", +static struct snd_soc_dai_driver nuc900_ac97_dai = { .probe = nuc900_ac97_probe, .remove = nuc900_ac97_remove, .ac97_control = 1, @@ -315,8 +312,7 @@ struct snd_soc_dai nuc900_ac97_dai = { .channels_max = 2, }, .ops = &nuc900_ac97_dai_ops, -} -EXPORT_SYMBOL_GPL(nuc900_ac97_dai); +}; static int __devinit nuc900_ac97_drvprobe(struct platform_device *pdev) { @@ -365,9 +361,7 @@ static int __devinit nuc900_ac97_drvprobe(struct platform_device *pdev) nuc900_ac97_data = nuc900_audio; - nuc900_audio->dev = nuc900_ac97_dai.dev = &pdev->dev; - - ret = snd_soc_register_dai(&nuc900_ac97_dai); + ret = snd_soc_register_dai(&pdev->dev, &nuc900_ac97_dai); if (ret) goto out3; @@ -389,14 +383,14 @@ out0: static int __devexit nuc900_ac97_drvremove(struct platform_device *pdev) { - - snd_soc_unregister_dai(&nuc900_ac97_dai); + snd_soc_unregister_dai(&pdev->dev); clk_put(nuc900_ac97_data->clk); iounmap(nuc900_ac97_data->mmio); release_mem_region(nuc900_ac97_data->res->start, resource_size(nuc900_ac97_data->res)); + kfree(nuc900_ac97_data); nuc900_ac97_data = NULL; return 0; @@ -404,7 +398,7 @@ static int __devexit nuc900_ac97_drvremove(struct platform_device *pdev) static struct platform_driver nuc900_ac97_driver = { .driver = { - .name = "nuc900-audio", + .name = "nuc900-ac97", .owner = THIS_MODULE, }, .probe = nuc900_ac97_drvprobe,