summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/rt5677.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2015-07-25 05:23:40 +0300
committerMark Brown <broonie@kernel.org>2015-07-29 15:56:50 +0300
commitf8163c8673efaabb361281a2759b3167d181ecf6 (patch)
treeb6dac11c4f13c4c82f9bf9abb2f68c2c0b2d0654 /sound/soc/codecs/rt5677.c
parentf285f1610341af4181791938777e0affb5531278 (diff)
downloadlinux-f8163c8673efaabb361281a2759b3167d181ecf6.tar.xz
ASoC: rt5677: Return error if devm_gpiod_get_optional return ERR_PTR
If devm_gpiod_get_optional() return ERR_PTR, it means something wrong so request gpio fails. We had better return error in such case. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/rt5677.c')
-rw-r--r--sound/soc/codecs/rt5677.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c
index 62230e05eac1..3f890a6708cd 100644
--- a/sound/soc/codecs/rt5677.c
+++ b/sound/soc/codecs/rt5677.c
@@ -5133,14 +5133,14 @@ static int rt5677_i2c_probe(struct i2c_client *i2c,
if (IS_ERR(rt5677->pow_ldo2)) {
ret = PTR_ERR(rt5677->pow_ldo2);
dev_err(&i2c->dev, "Failed to request POW_LDO2: %d\n", ret);
- rt5677->pow_ldo2 = 0;
+ return ret;
}
rt5677->reset_pin = devm_gpiod_get_optional(&i2c->dev,
"realtek,reset", GPIOD_OUT_HIGH);
if (IS_ERR(rt5677->reset_pin)) {
ret = PTR_ERR(rt5677->reset_pin);
dev_err(&i2c->dev, "Failed to request RESET: %d\n", ret);
- rt5677->reset_pin = 0;
+ return ret;
}
if (rt5677->pow_ldo2 || rt5677->reset_pin) {