summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/wm9712.c
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2014-10-30 23:01:05 +0300
committerMark Brown <broonie@kernel.org>2014-10-31 20:32:03 +0300
commit12ced338ab8858d11ef5b11b65c3dc612d9551c9 (patch)
tree12bc1aa1d5a4526779b958539aaef86159c4db46 /sound/soc/codecs/wm9712.c
parentf114040e3ea6e07372334ade75d1ee0775c355e1 (diff)
downloadlinux-12ced338ab8858d11ef5b11b65c3dc612d9551c9.tar.xz
ASoC: wm9712: Cleanup printk usage
Use dev_err() instead of printk(KERN_ERR. This is common practice and makes it easy to find out which device generated the message. While we are at it also align the error messages with the other AC'97 drivers. Also avoid printing two error messages when the reset fails. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/wm9712.c')
-rw-r--r--sound/soc/codecs/wm9712.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/sound/soc/codecs/wm9712.c b/sound/soc/codecs/wm9712.c
index c5eb746087b4..c389e5607ab6 100644
--- a/sound/soc/codecs/wm9712.c
+++ b/sound/soc/codecs/wm9712.c
@@ -595,7 +595,7 @@ static int wm9712_reset(struct snd_soc_codec *codec, int try_warm)
return 0;
err:
- printk(KERN_ERR "WM9712 AC97 reset failed\n");
+ dev_err(codec->dev, "Failed to reset: AC97 link error\n");
return -EIO;
}
@@ -611,10 +611,8 @@ static int wm9712_soc_resume(struct snd_soc_codec *codec)
u16 *cache = codec->reg_cache;
ret = wm9712_reset(codec, 1);
- if (ret < 0) {
- printk(KERN_ERR "could not reset AC97 codec\n");
+ if (ret < 0)
return ret;
- }
wm9712_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
@@ -637,15 +635,13 @@ static int wm9712_soc_probe(struct snd_soc_codec *codec)
ret = snd_soc_new_ac97_codec(codec, soc_ac97_ops, 0);
if (ret < 0) {
- printk(KERN_ERR "wm9712: failed to register AC97 codec\n");
+ dev_err(codec->dev, "Failed to register AC97 codec\n");
return ret;
}
ret = wm9712_reset(codec, 0);
- if (ret < 0) {
- printk(KERN_ERR "Failed to reset WM9712: AC97 link error\n");
+ if (ret < 0)
goto reset_err;
- }
/* set alc mux to none */
ac97_write(codec, AC97_VIDEO, ac97_read(codec, AC97_VIDEO) | 0x3000);