Merge branch 'for-5.0' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie...
authorMark Brown <broonie@kernel.org>
Mon, 4 Mar 2019 00:10:29 +0000 (00:10 +0000)
committerMark Brown <broonie@kernel.org>
Mon, 4 Mar 2019 00:10:29 +0000 (00:10 +0000)
1  2 
sound/soc/codecs/tlv320aic3x.c

index 283583d1db60555f0831229be3b2f0e1a65bafee,cea3ebecdb12b5e437f5621c8941b2e31b413ce3..516d17cb2182287f8f739a072fe3128687cecd93
@@@ -1609,20 -1609,18 +1609,19 @@@ static int aic3x_probe(struct snd_soc_c
        struct aic3x_priv *aic3x = snd_soc_component_get_drvdata(component);
        int ret, i;
  
-       INIT_LIST_HEAD(&aic3x->list);
        aic3x->component = component;
  
        for (i = 0; i < ARRAY_SIZE(aic3x->supplies); i++) {
                aic3x->disable_nb[i].nb.notifier_call = aic3x_regulator_event;
                aic3x->disable_nb[i].aic3x = aic3x;
 -              ret = regulator_register_notifier(aic3x->supplies[i].consumer,
 -                                                &aic3x->disable_nb[i].nb);
 +              ret = devm_regulator_register_notifier(
 +                                              aic3x->supplies[i].consumer,
 +                                              &aic3x->disable_nb[i].nb);
                if (ret) {
                        dev_err(component->dev,
                                "Failed to request regulator notifier: %d\n",
                                 ret);
 -                      goto err_notif;
 +                      return ret;
                }
        }
  
        aic3x_add_widgets(component);
  
        return 0;
 -
 -err_notif:
 -      while (i--)
 -              regulator_unregister_notifier(aic3x->supplies[i].consumer,
 -                                            &aic3x->disable_nb[i].nb);
 -      return ret;
 -}
 -
 -static void aic3x_remove(struct snd_soc_component *component)
 -{
 -      struct aic3x_priv *aic3x = snd_soc_component_get_drvdata(component);
 -      int i;
 -
 -      for (i = 0; i < ARRAY_SIZE(aic3x->supplies); i++)
 -              regulator_unregister_notifier(aic3x->supplies[i].consumer,
 -                                            &aic3x->disable_nb[i].nb);
  }
  
  static const struct snd_soc_component_driver soc_component_dev_aic3x = {
        .set_bias_level         = aic3x_set_bias_level,
        .probe                  = aic3x_probe,
 -      .remove                 = aic3x_remove,
        .controls               = aic3x_snd_controls,
        .num_controls           = ARRAY_SIZE(aic3x_snd_controls),
        .dapm_widgets           = aic3x_dapm_widgets,
@@@ -1873,6 -1888,7 +1872,7 @@@ static int aic3x_i2c_probe(struct i2c_c
        if (ret != 0)
                goto err_gpio;
  
+       INIT_LIST_HEAD(&aic3x->list);
        list_add(&aic3x->list, &reset_list);
  
        return 0;
@@@ -1889,6 -1905,8 +1889,8 @@@ static int aic3x_i2c_remove(struct i2c_
  {
        struct aic3x_priv *aic3x = i2c_get_clientdata(client);
  
+       list_del(&aic3x->list);
        if (gpio_is_valid(aic3x->gpio_reset) &&
            !aic3x_is_shared_reset(aic3x)) {
                gpio_set_value(aic3x->gpio_reset, 0);