From: Gary Zhang Date: Fri, 26 Oct 2012 08:16:56 +0000 (+0800) Subject: ENGR00231321-2 wm8962: enhance audio driver X-Git-Tag: v3.0.35-fsl~318 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=df8dce9766bdbca1dc91dbba694ff4e9d3785b86;p=karo-tx-linux.git ENGR00231321-2 wm8962: enhance audio driver 1. correct indent issue 2. when driver is unloaded, remove disable clock operateion and free irq Signed-off-by: Gary Zhang --- diff --git a/sound/soc/imx/imx-wm8962.c b/sound/soc/imx/imx-wm8962.c index b13f68f2647b..04aca39ab2d5 100644 --- a/sound/soc/imx/imx-wm8962.c +++ b/sound/soc/imx/imx-wm8962.c @@ -324,25 +324,25 @@ static int imx_wm8962_init(struct snd_soc_pcm_runtime *rtd) snd_soc_dapm_sync(&codec->dapm); if (plat->hp_gpio != -1) { - priv->hp_irq = gpio_to_irq(plat->hp_gpio); - - ret = request_irq(priv->hp_irq, - imx_headphone_detect_handler, - IRQ_TYPE_EDGE_BOTH, pdev->name, priv); - - if (ret < 0) { - ret = -EINVAL; - return ret; - } - - ret = driver_create_file(pdev->dev.driver, - &driver_attr_headphone); - if (ret < 0) { - ret = -EINVAL; - return ret; - } + priv->hp_irq = gpio_to_irq(plat->hp_gpio); + + ret = request_irq(priv->hp_irq, + imx_headphone_detect_handler, + IRQ_TYPE_EDGE_BOTH, pdev->name, priv); + + if (ret < 0) { + ret = -EINVAL; + return ret; } + ret = driver_create_file(pdev->dev.driver, + &driver_attr_headphone); + if (ret < 0) { + ret = -EINVAL; + return ret; + } + } + if (plat->mic_gpio != -1) { priv->amic_irq = gpio_to_irq(plat->mic_gpio); @@ -447,12 +447,16 @@ static int __devinit imx_wm8962_probe(struct platform_device *pdev) static int __devexit imx_wm8962_remove(struct platform_device *pdev) { struct mxc_audio_platform_data *plat = pdev->dev.platform_data; - - plat->clock_enable(0); + struct imx_priv *priv = &card_priv; if (plat->finit) plat->finit(); + if (priv->hp_irq) + free_irq(priv->hp_irq, priv); + if (priv->amic_irq) + free_irq(priv->amic_irq, priv); + return 0; }