summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/tas6424.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/tas6424.c')
-rw-r--r--sound/soc/codecs/tas6424.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/sound/soc/codecs/tas6424.c b/sound/soc/codecs/tas6424.c
index 59543d392110..22b53856e691 100644
--- a/sound/soc/codecs/tas6424.c
+++ b/sound/soc/codecs/tas6424.c
@@ -682,8 +682,7 @@ static const struct of_device_id tas6424_of_ids[] = {
MODULE_DEVICE_TABLE(of, tas6424_of_ids);
#endif
-static int tas6424_i2c_probe(struct i2c_client *client,
- const struct i2c_device_id *id)
+static int tas6424_i2c_probe(struct i2c_client *client)
{
struct device *dev = &client->dev;
struct tas6424_data *tas6424;
@@ -757,7 +756,7 @@ static int tas6424_i2c_probe(struct i2c_client *client,
TAS6424_RESET, TAS6424_RESET);
if (ret) {
dev_err(dev, "unable to reset device: %d\n", ret);
- return ret;
+ goto disable_regs;
}
INIT_DELAYED_WORK(&tas6424->fault_check_work, tas6424_fault_check_work);
@@ -766,10 +765,14 @@ static int tas6424_i2c_probe(struct i2c_client *client,
tas6424_dai, ARRAY_SIZE(tas6424_dai));
if (ret < 0) {
dev_err(dev, "unable to register codec: %d\n", ret);
- return ret;
+ goto disable_regs;
}
return 0;
+
+disable_regs:
+ regulator_bulk_disable(ARRAY_SIZE(tas6424->supplies), tas6424->supplies);
+ return ret;
}
static int tas6424_i2c_remove(struct i2c_client *client)
@@ -786,10 +789,8 @@ static int tas6424_i2c_remove(struct i2c_client *client)
ret = regulator_bulk_disable(ARRAY_SIZE(tas6424->supplies),
tas6424->supplies);
- if (ret < 0) {
+ if (ret < 0)
dev_err(dev, "unable to disable supplies: %d\n", ret);
- return ret;
- }
return 0;
}
@@ -805,7 +806,7 @@ static struct i2c_driver tas6424_i2c_driver = {
.name = "tas6424",
.of_match_table = of_match_ptr(tas6424_of_ids),
},
- .probe = tas6424_i2c_probe,
+ .probe_new = tas6424_i2c_probe,
.remove = tas6424_i2c_remove,
.id_table = tas6424_i2c_ids,
};