ASoC: mt6660: Fix PM disable depth imbalance in mt6660_i2c_probe
[platform/kernel/linux-rpi.git] / sound / soc / codecs / mt6660.c
index 358c500..a0a3fd6 100644 (file)
@@ -504,13 +504,17 @@ static int mt6660_i2c_probe(struct i2c_client *client,
                dev_err(chip->dev, "read chip revision fail\n");
                goto probe_fail;
        }
-       pm_runtime_set_active(chip->dev);
-       pm_runtime_enable(chip->dev);
 
        ret = devm_snd_soc_register_component(chip->dev,
                                               &mt6660_component_driver,
                                               &mt6660_codec_dai, 1);
+       if (!ret) {
+               pm_runtime_set_active(chip->dev);
+               pm_runtime_enable(chip->dev);
+       }
+
        return ret;
+
 probe_fail:
        _mt6660_chip_power_on(chip, 0);
        mutex_destroy(&chip->io_lock);