Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 93e051d2 authored by Mark Brown's avatar Mark Brown
Browse files

ASoC: Only unregister drivers we registered for WM8753

parent eeb1080b
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -1845,6 +1845,7 @@ static int wm8753_remove(struct platform_device *pdev)
{
	struct snd_soc_device *socdev = platform_get_drvdata(pdev);
	struct snd_soc_codec *codec = socdev->card->codec;
	struct wm8753_setup_data *setup = socdev->codec_data;

	if (codec->control_data)
		wm8753_set_bias_level(codec, SND_SOC_BIAS_OFF);
@@ -1852,10 +1853,13 @@ static int wm8753_remove(struct platform_device *pdev)
	snd_soc_free_pcms(socdev);
	snd_soc_dapm_free(socdev);
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
	if (setup->i2c_address) {
		i2c_unregister_device(codec->control_data);
		i2c_del_driver(&wm8753_i2c_driver);
	}
#endif
#if defined(CONFIG_SPI_MASTER)
	if (setup->spi)
		spi_unregister_driver(&wm8753_spi_driver);
#endif
	kfree(codec->private_data);