mirror of
https://github.com/adulau/aha.git
synced 2025-01-01 13:46:24 +00:00
ASoC: delete -spi suffix in ad1938 and free private data while registers fail
Signed-off-by: Barry Song <21cnbao@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
parent
9028935d75
commit
2a708137fd
1 changed files with 3 additions and 1 deletions
|
@ -456,7 +456,7 @@ static int __devexit ad1938_spi_remove(struct spi_device *spi)
|
||||||
|
|
||||||
static struct spi_driver ad1938_spi_driver = {
|
static struct spi_driver ad1938_spi_driver = {
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "ad1938-spi",
|
.name = "ad1938",
|
||||||
.bus = &spi_bus_type,
|
.bus = &spi_bus_type,
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
},
|
},
|
||||||
|
@ -543,6 +543,7 @@ static int ad1938_register(struct ad1938_priv *ad1938)
|
||||||
ret = snd_soc_register_codec(codec);
|
ret = snd_soc_register_codec(codec);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
dev_err(codec->dev, "Failed to register codec: %d\n", ret);
|
dev_err(codec->dev, "Failed to register codec: %d\n", ret);
|
||||||
|
kfree(ad1938);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -550,6 +551,7 @@ static int ad1938_register(struct ad1938_priv *ad1938)
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
dev_err(codec->dev, "Failed to register DAI: %d\n", ret);
|
dev_err(codec->dev, "Failed to register DAI: %d\n", ret);
|
||||||
snd_soc_unregister_codec(codec);
|
snd_soc_unregister_codec(codec);
|
||||||
|
kfree(ad1938);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue