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

Commit c8da5ca0 authored by Karthikeyan Mani's avatar Karthikeyan Mani
Browse files

ASoC: msm: Free the gpio on remove



Check for validity of gpio and free it
before putting it down in remove function.

CRs-fixed: 2092930
Change-Id: Ief9981629490b576c36539ae85e4a0ff56140efc
Signed-off-by: default avatarKarthikeyan Mani <kmani@codeaurora.org>
parent 72f16cf8
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -217,8 +217,14 @@ static int msm_cdc_pinctrl_remove(struct platform_device *pdev)

	gpio_data = dev_get_drvdata(&pdev->dev);

	if (gpio_data && gpio_data->pinctrl)
	/* to free the requested gpio before exiting */
	if (gpio_data) {
		if (gpio_is_valid(gpio_data->gpio))
			gpio_free(gpio_data->gpio);

		if (gpio_data->pinctrl)
			devm_pinctrl_put(gpio_data->pinctrl);
	}

	devm_kfree(&pdev->dev, gpio_data);