Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 342658
b: refs/heads/master
c: a273cd1
h: refs/heads/master
v: v3
  • Loading branch information
Tushar Behera authored and Mark Brown committed Nov 23, 2012
1 parent 1d83ac3 commit 5fc8124
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 385a4c2e286571ba824ee5312f506f198866c3b5
refs/heads/master: a273cd13a5b168ceed5c0a0e07bda530479d7f47
19 changes: 4 additions & 15 deletions trunk/sound/soc/codecs/ak4104.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ static int ak4104_spi_probe(struct spi_device *spi)
if (ak4104 == NULL)
return -ENOMEM;

ak4104->regmap = regmap_init_spi(spi, &ak4104_regmap);
ak4104->regmap = devm_regmap_init_spi(spi, &ak4104_regmap);
if (IS_ERR(ak4104->regmap)) {
ret = PTR_ERR(ak4104->regmap);
return ret;
Expand All @@ -247,30 +247,19 @@ static int ak4104_spi_probe(struct spi_device *spi)
* the device, but there is no hardware ID register. */
ret = regmap_read(ak4104->regmap, AK4104_REG_RESERVED, &val);
if (ret != 0)
goto err;
if (val != AK4104_RESERVED_VAL) {
ret = -ENODEV;
goto err;
}
return ret;
if (val != AK4104_RESERVED_VAL)
return -ENODEV;

spi_set_drvdata(spi, ak4104);

ret = snd_soc_register_codec(&spi->dev,
&soc_codec_device_ak4104, &ak4104_dai, 1);
if (ret != 0)
goto err;

return 0;

err:
regmap_exit(ak4104->regmap);
return ret;
}

static int __devexit ak4104_spi_remove(struct spi_device *spi)
{
struct ak4104_private *ak4101 = spi_get_drvdata(spi);
regmap_exit(ak4101->regmap);
snd_soc_unregister_codec(&spi->dev);
return 0;
}
Expand Down

0 comments on commit 5fc8124

Please sign in to comment.