ASoC: tlv320adcx140: Fix accessing uninitialized adcx140->dev
In adcx140_i2c_probe, adcx140->dev is accessed before its
initialization. This commit fixes this bug.
Fixes: 689c7655b5
("ASoC: tlv320adcx140: Add the tlv320adcx140 codec driver family")
Acked-by: Dan Murphy <dmurphy@ti.com>
Signed-off-by: Camel Guo <camel.guo@axis.com>
Link: https://lore.kernel.org/r/20200901135736.32036-1-camel.guo@axis.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
f5a2cda4f1
commit
2569231d71
|
@ -980,6 +980,8 @@ static int adcx140_i2c_probe(struct i2c_client *i2c,
|
|||
if (!adcx140)
|
||||
return -ENOMEM;
|
||||
|
||||
adcx140->dev = &i2c->dev;
|
||||
|
||||
adcx140->gpio_reset = devm_gpiod_get_optional(adcx140->dev,
|
||||
"reset", GPIOD_OUT_LOW);
|
||||
if (IS_ERR(adcx140->gpio_reset))
|
||||
|
@ -1007,7 +1009,7 @@ static int adcx140_i2c_probe(struct i2c_client *i2c,
|
|||
ret);
|
||||
return ret;
|
||||
}
|
||||
adcx140->dev = &i2c->dev;
|
||||
|
||||
i2c_set_clientdata(i2c, adcx140);
|
||||
|
||||
return devm_snd_soc_register_component(&i2c->dev,
|
||||
|
|
Loading…
Reference in New Issue