diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2014-07-25 13:12:54 +0300 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-07-25 19:00:05 +0100 |
commit | a72d2abbe5752f3a773c4d8b7b41ae41f617f772 (patch) | |
tree | 3eccc2468e314a6d084996be1fc12e2295945fa2 /sound/soc/codecs/tlv320aic31xx.c | |
parent | 7171511eaec5bf23fb06078f59784a3a0626b38f (diff) | |
download | op-kernel-dev-a72d2abbe5752f3a773c4d8b7b41ae41f617f772.zip op-kernel-dev-a72d2abbe5752f3a773c4d8b7b41ae41f617f772.tar.gz |
ASoC: tlv320aic31xx: Do not ignore errors in aic31xx_device_init()
We need to return the error codes from aic31xx_device_init() and return
from the i2c_probe with the error code.
We will have kernel panic (NULL pointer dereference) in
regulator_register_notifier() in case the devm_regulator_bulk_get() fails
(with -EPROBE_DEFER for example).
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org
Diffstat (limited to 'sound/soc/codecs/tlv320aic31xx.c')
-rw-r--r-- | sound/soc/codecs/tlv320aic31xx.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sound/soc/codecs/tlv320aic31xx.c b/sound/soc/codecs/tlv320aic31xx.c index 2341910..1cdae8c 100644 --- a/sound/soc/codecs/tlv320aic31xx.c +++ b/sound/soc/codecs/tlv320aic31xx.c @@ -1178,7 +1178,7 @@ static void aic31xx_pdata_from_of(struct aic31xx_priv *aic31xx) } #endif /* CONFIG_OF */ -static void aic31xx_device_init(struct aic31xx_priv *aic31xx) +static int aic31xx_device_init(struct aic31xx_priv *aic31xx) { int ret, i; @@ -1197,7 +1197,7 @@ static void aic31xx_device_init(struct aic31xx_priv *aic31xx) "aic31xx-reset-pin"); if (ret < 0) { dev_err(aic31xx->dev, "not able to acquire gpio\n"); - return; + return ret; } } @@ -1210,6 +1210,7 @@ static void aic31xx_device_init(struct aic31xx_priv *aic31xx) if (ret != 0) dev_err(aic31xx->dev, "Failed to request supplies: %d\n", ret); + return ret; } static int aic31xx_i2c_probe(struct i2c_client *i2c, @@ -1239,7 +1240,9 @@ static int aic31xx_i2c_probe(struct i2c_client *i2c, aic31xx->pdata.codec_type = id->driver_data; - aic31xx_device_init(aic31xx); + ret = aic31xx_device_init(aic31xx); + if (ret) + return ret; return snd_soc_register_codec(&i2c->dev, &soc_codec_driver_aic31xx, aic31xx_dai_driver, |