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

Commit 30fe05e7 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "audio-lnx: asoc: sdm660: fix rmmod issue with gpio_free"

parents 1cb9edcc c4ef3b5e
Loading
Loading
Loading
Loading
+12 −18
Original line number Diff line number Diff line
@@ -3135,20 +3135,6 @@ static int msm_init_wsa_dev(struct platform_device *pdev,
	return ret;
}

static void msm_free_auxdev_mem(struct platform_device *pdev)
{
	struct snd_soc_card *card = platform_get_drvdata(pdev);
	int i;

	if (card->num_aux_devs > 0) {
		for (i = 0; i < card->num_aux_devs; i++) {
			kfree(msm_aux_dev[i].codec_name);
			kfree(msm_codec_conf[i].dev_name);
			kfree(msm_codec_conf[i].name_prefix);
		}
	}
}

static void i2s_auxpcm_init(struct platform_device *pdev)
{
	int count;
@@ -3367,10 +3353,18 @@ static int msm_asoc_machine_remove(struct platform_device *pdev)
	if (pdata->snd_card_val == INT_SND_CARD)
		mutex_destroy(&pdata->cdc_int_mclk0_mutex);

	msm_free_auxdev_mem(pdev);
	if (gpio_is_valid(pdata->us_euro_gpio)) {
		gpio_free(pdata->us_euro_gpio);
		pdata->us_euro_gpio = 0;
	}
	if (gpio_is_valid(pdata->hph_en1_gpio)) {
		gpio_free(pdata->hph_en1_gpio);
		pdata->hph_en1_gpio = 0;
	}
	if (gpio_is_valid(pdata->hph_en0_gpio)) {
		gpio_free(pdata->hph_en0_gpio);
		pdata->hph_en0_gpio = 0;
	}

	if (pdata->snd_card_val != INT_SND_CARD)
		audio_notifier_deregister("sdm660");