summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-12-02 13:35:31 +0900
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-12-02 13:35:31 +0900
commitd88c7dd20c9cf5cbd3304c0cc9630bd5207b596b (patch)
treec00e1426ac79d79b25f1dddc8642878b6e56fb57 /sound
parentd7ba2556a0f74076eaac6187f0dd8806a81563df (diff)
parenta5710c0135db75f1c97c31e835f37d1e94096346 (diff)
downloadlinux-3.10-d88c7dd20c9cf5cbd3304c0cc9630bd5207b596b.tar.gz
linux-3.10-d88c7dd20c9cf5cbd3304c0cc9630bd5207b596b.tar.bz2
linux-3.10-d88c7dd20c9cf5cbd3304c0cc9630bd5207b596b.zip
Merge remote-tracking branch 'asoc/topic/wm9081' into asoc-next
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/wm9081.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/sound/soc/codecs/wm9081.c b/sound/soc/codecs/wm9081.c
index 2de74e1ea22..860144e85e0 100644
--- a/sound/soc/codecs/wm9081.c
+++ b/sound/soc/codecs/wm9081.c
@@ -1341,28 +1341,27 @@ static __devinit int wm9081_i2c_probe(struct i2c_client *i2c,
i2c_set_clientdata(i2c, wm9081);
- wm9081->regmap = regmap_init_i2c(i2c, &wm9081_regmap);
+ wm9081->regmap = devm_regmap_init_i2c(i2c, &wm9081_regmap);
if (IS_ERR(wm9081->regmap)) {
ret = PTR_ERR(wm9081->regmap);
dev_err(&i2c->dev, "regmap_init() failed: %d\n", ret);
- goto err;
+ return ret;
}
ret = regmap_read(wm9081->regmap, WM9081_SOFTWARE_RESET, &reg);
if (ret != 0) {
dev_err(&i2c->dev, "Failed to read chip ID: %d\n", ret);
- goto err_regmap;
+ return ret;
}
if (reg != 0x9081) {
dev_err(&i2c->dev, "Device is not a WM9081: ID=0x%x\n", reg);
- ret = -EINVAL;
- goto err_regmap;
+ return -EINVAL;
}
ret = wm9081_reset(wm9081->regmap);
if (ret < 0) {
dev_err(&i2c->dev, "Failed to issue reset\n");
- goto err_regmap;
+ return ret;
}
if (dev_get_platdata(&i2c->dev))
@@ -1382,23 +1381,14 @@ static __devinit int wm9081_i2c_probe(struct i2c_client *i2c,
ret = snd_soc_register_codec(&i2c->dev,
&soc_codec_dev_wm9081, &wm9081_dai, 1);
if (ret < 0)
- goto err_regmap;
+ return ret;
return 0;
-
-err_regmap:
- regmap_exit(wm9081->regmap);
-err:
-
- return ret;
}
static __devexit int wm9081_i2c_remove(struct i2c_client *client)
{
- struct wm9081_priv *wm9081 = i2c_get_clientdata(client);
-
snd_soc_unregister_codec(&client->dev);
- regmap_exit(wm9081->regmap);
return 0;
}