Skip to content

Commit

Permalink
ASoC: delete -spi suffix in ad1938 and free private data while regist…
Browse files Browse the repository at this point in the history
…ers fail

Signed-off-by: Barry Song <21cnbao@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Barry Song authored and Mark Brown committed Aug 14, 2009
1 parent 9028935 commit 2a70813
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sound/soc/codecs/ad1938.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ static int __devexit ad1938_spi_remove(struct spi_device *spi)

static struct spi_driver ad1938_spi_driver = {
.driver = {
.name = "ad1938-spi",
.name = "ad1938",
.bus = &spi_bus_type,
.owner = THIS_MODULE,
},
Expand Down Expand Up @@ -543,13 +543,15 @@ static int ad1938_register(struct ad1938_priv *ad1938)
ret = snd_soc_register_codec(codec);
if (ret != 0) {
dev_err(codec->dev, "Failed to register codec: %d\n", ret);
kfree(ad1938);
return ret;
}

ret = snd_soc_register_dai(&ad1938_dai);
if (ret != 0) {
dev_err(codec->dev, "Failed to register DAI: %d\n", ret);
snd_soc_unregister_codec(codec);
kfree(ad1938);
return ret;
}

Expand Down

0 comments on commit 2a70813

Please sign in to comment.