diff options
Diffstat (limited to 'sound/soc/codecs/tlv320dac33.c')
-rw-r--r-- | sound/soc/codecs/tlv320dac33.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/sound/soc/codecs/tlv320dac33.c b/sound/soc/codecs/tlv320dac33.c index 6bfc8a17331b..df3a7506c023 100644 --- a/sound/soc/codecs/tlv320dac33.c +++ b/sound/soc/codecs/tlv320dac33.c | |||
@@ -442,7 +442,7 @@ static int dac33_playback_event(struct snd_soc_dapm_widget *w, | |||
442 | static int dac33_get_fifo_mode(struct snd_kcontrol *kcontrol, | 442 | static int dac33_get_fifo_mode(struct snd_kcontrol *kcontrol, |
443 | struct snd_ctl_elem_value *ucontrol) | 443 | struct snd_ctl_elem_value *ucontrol) |
444 | { | 444 | { |
445 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); | 445 | struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); |
446 | struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec); | 446 | struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec); |
447 | 447 | ||
448 | ucontrol->value.integer.value[0] = dac33->fifo_mode; | 448 | ucontrol->value.integer.value[0] = dac33->fifo_mode; |
@@ -453,7 +453,7 @@ static int dac33_get_fifo_mode(struct snd_kcontrol *kcontrol, | |||
453 | static int dac33_set_fifo_mode(struct snd_kcontrol *kcontrol, | 453 | static int dac33_set_fifo_mode(struct snd_kcontrol *kcontrol, |
454 | struct snd_ctl_elem_value *ucontrol) | 454 | struct snd_ctl_elem_value *ucontrol) |
455 | { | 455 | { |
456 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); | 456 | struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); |
457 | struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec); | 457 | struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec); |
458 | int ret = 0; | 458 | int ret = 0; |
459 | 459 | ||
@@ -1540,7 +1540,7 @@ static int dac33_i2c_probe(struct i2c_client *client, | |||
1540 | for (i = 0; i < ARRAY_SIZE(dac33->supplies); i++) | 1540 | for (i = 0; i < ARRAY_SIZE(dac33->supplies); i++) |
1541 | dac33->supplies[i].supply = dac33_supply_names[i]; | 1541 | dac33->supplies[i].supply = dac33_supply_names[i]; |
1542 | 1542 | ||
1543 | ret = regulator_bulk_get(&client->dev, ARRAY_SIZE(dac33->supplies), | 1543 | ret = devm_regulator_bulk_get(&client->dev, ARRAY_SIZE(dac33->supplies), |
1544 | dac33->supplies); | 1544 | dac33->supplies); |
1545 | 1545 | ||
1546 | if (ret != 0) { | 1546 | if (ret != 0) { |
@@ -1551,11 +1551,9 @@ static int dac33_i2c_probe(struct i2c_client *client, | |||
1551 | ret = snd_soc_register_codec(&client->dev, | 1551 | ret = snd_soc_register_codec(&client->dev, |
1552 | &soc_codec_dev_tlv320dac33, &dac33_dai, 1); | 1552 | &soc_codec_dev_tlv320dac33, &dac33_dai, 1); |
1553 | if (ret < 0) | 1553 | if (ret < 0) |
1554 | goto err_register; | 1554 | goto err_get; |
1555 | 1555 | ||
1556 | return ret; | 1556 | return ret; |
1557 | err_register: | ||
1558 | regulator_bulk_free(ARRAY_SIZE(dac33->supplies), dac33->supplies); | ||
1559 | err_get: | 1557 | err_get: |
1560 | if (dac33->power_gpio >= 0) | 1558 | if (dac33->power_gpio >= 0) |
1561 | gpio_free(dac33->power_gpio); | 1559 | gpio_free(dac33->power_gpio); |
@@ -1573,8 +1571,6 @@ static int dac33_i2c_remove(struct i2c_client *client) | |||
1573 | if (dac33->power_gpio >= 0) | 1571 | if (dac33->power_gpio >= 0) |
1574 | gpio_free(dac33->power_gpio); | 1572 | gpio_free(dac33->power_gpio); |
1575 | 1573 | ||
1576 | regulator_bulk_free(ARRAY_SIZE(dac33->supplies), dac33->supplies); | ||
1577 | |||
1578 | snd_soc_unregister_codec(&client->dev); | 1574 | snd_soc_unregister_codec(&client->dev); |
1579 | return 0; | 1575 | return 0; |
1580 | } | 1576 | } |