Merge branch 'fix/asoc' into for-linus

+85 -38
+6 -3
sound/soc/atmel/sam9g20_wm8731.c
··· 222 222 } 223 223 224 224 pllb = clk_get(NULL, "pllb"); 225 - if (IS_ERR(mclk)) { 225 + if (IS_ERR(pllb)) { 226 226 printk(KERN_ERR "ASoC: Failed to get PLLB\n"); 227 - ret = PTR_ERR(mclk); 227 + ret = PTR_ERR(pllb); 228 228 goto err_mclk; 229 229 } 230 230 ret = clk_set_parent(mclk, pllb); ··· 240 240 if (!at91sam9g20ek_snd_device) { 241 241 printk(KERN_ERR "ASoC: Platform device allocation failed\n"); 242 242 ret = -ENOMEM; 243 + goto err_mclk; 243 244 } 244 245 245 246 platform_set_drvdata(at91sam9g20ek_snd_device, ··· 249 248 ret = platform_device_add(at91sam9g20ek_snd_device); 250 249 if (ret) { 251 250 printk(KERN_ERR "ASoC: Platform device allocation failed\n"); 252 - platform_device_put(at91sam9g20ek_snd_device); 251 + goto err_device_add; 253 252 } 254 253 255 254 return ret; 256 255 256 + err_device_add: 257 + platform_device_put(at91sam9g20ek_snd_device); 257 258 err_mclk: 258 259 clk_put(mclk); 259 260 mclk = NULL;
-1
sound/soc/atmel/snd-soc-afeb9260.c
··· 167 167 168 168 return 0; 169 169 err1: 170 - platform_device_del(afeb9260_snd_device); 171 170 platform_device_put(afeb9260_snd_device); 172 171 return err; 173 172 }
+3
sound/soc/codecs/max98088.c
··· 2019 2019 2020 2020 static int max98088_remove(struct snd_soc_codec *codec) 2021 2021 { 2022 + struct max98088_priv *max98088 = snd_soc_codec_get_drvdata(codec); 2023 + 2022 2024 max98088_set_bias_level(codec, SND_SOC_BIAS_OFF); 2025 + kfree(max98088->eq_texts); 2023 2026 2024 2027 return 0; 2025 2028 }
+1
sound/soc/codecs/stac9766.c
··· 383 383 .reg_cache_size = sizeof(stac9766_reg), 384 384 .reg_word_size = sizeof(u16), 385 385 .reg_cache_step = 2, 386 + .reg_cache_default = stac9766_reg, 386 387 }; 387 388 388 389 static __devinit int stac9766_probe(struct platform_device *pdev)
+3 -3
sound/soc/codecs/tlv320aic3x.c
··· 1176 1176 int aic3x_get_gpio(struct snd_soc_codec *codec, int gpio) 1177 1177 { 1178 1178 u8 reg = gpio ? AIC3X_GPIO2_REG : AIC3X_GPIO1_REG; 1179 - u8 val, bit = gpio ? 2: 1; 1179 + u8 val = 0, bit = gpio ? 2 : 1; 1180 1180 1181 1181 aic3x_read(codec, reg, &val); 1182 1182 return (val >> bit) & 1; ··· 1204 1204 1205 1205 int aic3x_headset_detected(struct snd_soc_codec *codec) 1206 1206 { 1207 - u8 val; 1207 + u8 val = 0; 1208 1208 aic3x_read(codec, AIC3X_HEADSET_DETECT_CTRL_B, &val); 1209 1209 return (val >> 4) & 1; 1210 1210 } ··· 1212 1212 1213 1213 int aic3x_button_pressed(struct snd_soc_codec *codec) 1214 1214 { 1215 - u8 val; 1215 + u8 val = 0; 1216 1216 aic3x_read(codec, AIC3X_HEADSET_DETECT_CTRL_B, &val); 1217 1217 return (val >> 5) & 1; 1218 1218 }
+3 -1
sound/soc/codecs/tpa6130a2.c
··· 78 78 79 79 if (data->power_state) { 80 80 val = i2c_smbus_write_byte_data(tpa6130a2_client, reg, value); 81 - if (val < 0) 81 + if (val < 0) { 82 82 dev_err(&tpa6130a2_client->dev, "Write failed\n"); 83 + return val; 84 + } 83 85 } 84 86 85 87 /* Either powered on or off, we save the context */
-1
sound/soc/codecs/wm8523.c
··· 146 146 return -EINVAL; 147 147 } 148 148 149 - return 0; 150 149 snd_pcm_hw_constraint_list(substream->runtime, 0, 151 150 SNDRV_PCM_HW_PARAM_RATE, 152 151 &wm8523->rate_constraint);
+2
sound/soc/codecs/wm8904.c
··· 2498 2498 2499 2499 wm8904_set_bias_level(codec, SND_SOC_BIAS_OFF); 2500 2500 regulator_bulk_free(ARRAY_SIZE(wm8904->supplies), wm8904->supplies); 2501 + kfree(wm8904->retune_mobile_texts); 2502 + kfree(wm8904->drc_texts); 2501 2503 2502 2504 return 0; 2503 2505 }
+2 -2
sound/soc/codecs/wm8961.c
··· 711 711 if (fs <= 24000) 712 712 reg |= WM8961_DACSLOPE; 713 713 else 714 - reg &= WM8961_DACSLOPE; 714 + reg &= ~WM8961_DACSLOPE; 715 715 snd_soc_write(codec, WM8961_ADC_DAC_CONTROL_2, reg); 716 716 717 717 return 0; ··· 736 736 freq /= 2; 737 737 } else { 738 738 dev_dbg(codec->dev, "Using MCLK/1 for %dHz MCLK\n", freq); 739 - reg &= WM8961_MCLKDIV; 739 + reg &= ~WM8961_MCLKDIV; 740 740 } 741 741 742 742 snd_soc_write(codec, WM8961_CLOCKING1, reg);
+4
sound/soc/codecs/wm8994.c
··· 4061 4061 wm8994_free_irq(codec->control_data, WM8994_IRQ_MIC2_DET, wm8994); 4062 4062 wm8994_free_irq(codec->control_data, WM8994_IRQ_MIC1_SHRT, wm8994); 4063 4063 wm8994_free_irq(codec->control_data, WM8994_IRQ_MIC1_DET, wm8994); 4064 + kfree(wm8994->retune_mobile_texts); 4065 + kfree(wm8994->drc_texts); 4064 4066 kfree(wm8994); 4065 4067 4066 4068 return 0; ··· 4075 4073 .resume = wm8994_resume, 4076 4074 .read = wm8994_read, 4077 4075 .write = wm8994_write, 4076 + .readable_register = wm8994_readable, 4077 + .volatile_register = wm8994_volatile, 4078 4078 .set_bias_level = wm8994_set_bias_level, 4079 4079 }; 4080 4080
+3
sound/soc/davinci/davinci-vcif.c
··· 247 247 248 248 static int davinci_vcif_remove(struct platform_device *pdev) 249 249 { 250 + struct davinci_vcif_dev *davinci_vcif_dev = dev_get_drvdata(&pdev->dev); 251 + 250 252 snd_soc_unregister_dai(&pdev->dev); 253 + kfree(davinci_vcif_dev); 251 254 252 255 return 0; 253 256 }
+10 -8
sound/soc/ep93xx/simone.c
··· 54 54 55 55 ret = platform_device_add(simone_snd_ac97_device); 56 56 if (ret) 57 - goto fail; 57 + goto fail1; 58 58 59 59 simone_snd_device = platform_device_alloc("soc-audio", -1); 60 60 if (!simone_snd_device) { 61 61 ret = -ENOMEM; 62 - goto fail; 62 + goto fail2; 63 63 } 64 64 65 65 platform_set_drvdata(simone_snd_device, &snd_soc_simone); 66 66 ret = platform_device_add(simone_snd_device); 67 - if (ret) { 68 - platform_device_put(simone_snd_device); 69 - goto fail; 70 - } 67 + if (ret) 68 + goto fail3; 71 69 72 - return ret; 70 + return 0; 73 71 74 - fail: 72 + fail3: 73 + platform_device_put(simone_snd_device); 74 + fail2: 75 + platform_device_del(simone_snd_ac97_device); 76 + fail1: 75 77 platform_device_put(simone_snd_ac97_device); 76 78 return ret; 77 79 }
+1
sound/soc/fsl/efika-audio-fabric.c
··· 76 76 rc = platform_device_add(pdev); 77 77 if (rc) { 78 78 pr_err("efika_fabric_init: platform_device_add() failed\n"); 79 + platform_device_put(pdev); 79 80 return -ENODEV; 80 81 } 81 82 return 0;
-1
sound/soc/fsl/mpc5200_dma.c
··· 9 9 #include <linux/module.h> 10 10 #include <linux/of_device.h> 11 11 #include <linux/slab.h> 12 - #include <linux/of_device.h> 13 12 #include <linux/of_platform.h> 14 13 15 14 #include <sound/soc.h>
+1
sound/soc/fsl/pcm030-audio-fabric.c
··· 76 76 rc = platform_device_add(pdev); 77 77 if (rc) { 78 78 pr_err("pcm030_fabric_init: platform_device_add() failed\n"); 79 + platform_device_put(pdev); 79 80 return -ENODEV; 80 81 } 81 82 return 0;
+11 -4
sound/soc/imx/imx-ssi.c
··· 679 679 } 680 680 681 681 ssi->soc_platform_pdev_fiq = platform_device_alloc("imx-fiq-pcm-audio", pdev->id); 682 - if (!ssi->soc_platform_pdev_fiq) 682 + if (!ssi->soc_platform_pdev_fiq) { 683 + ret = -ENOMEM; 683 684 goto failed_pdev_fiq_alloc; 685 + } 686 + 684 687 platform_set_drvdata(ssi->soc_platform_pdev_fiq, ssi); 685 688 ret = platform_device_add(ssi->soc_platform_pdev_fiq); 686 689 if (ret) { ··· 692 689 } 693 690 694 691 ssi->soc_platform_pdev = platform_device_alloc("imx-pcm-audio", pdev->id); 695 - if (!ssi->soc_platform_pdev) 692 + if (!ssi->soc_platform_pdev) { 693 + ret = -ENOMEM; 696 694 goto failed_pdev_alloc; 695 + } 696 + 697 697 platform_set_drvdata(ssi->soc_platform_pdev, ssi); 698 698 ret = platform_device_add(ssi->soc_platform_pdev); 699 699 if (ret) { ··· 709 703 failed_pdev_add: 710 704 platform_device_put(ssi->soc_platform_pdev); 711 705 failed_pdev_alloc: 706 + platform_device_del(ssi->soc_platform_pdev_fiq); 712 707 failed_pdev_fiq_add: 713 708 platform_device_put(ssi->soc_platform_pdev_fiq); 714 709 failed_pdev_fiq_alloc: ··· 733 726 struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 734 727 struct imx_ssi *ssi = platform_get_drvdata(pdev); 735 728 736 - platform_device_del(ssi->soc_platform_pdev); 737 - platform_device_put(ssi->soc_platform_pdev); 729 + platform_device_unregister(ssi->soc_platform_pdev); 730 + platform_device_unregister(ssi->soc_platform_pdev_fiq); 738 731 739 732 snd_soc_unregister_dai(&pdev->dev); 740 733
+21 -7
sound/soc/imx/phycore-ac97.c
··· 43 43 .num_links = ARRAY_SIZE(imx_phycore_dai_ac97), 44 44 }; 45 45 46 + static struct platform_device *imx_phycore_snd_ac97_device; 46 47 static struct platform_device *imx_phycore_snd_device; 47 48 48 49 static int __init imx_phycore_init(void) ··· 54 53 /* return happy. We might run on a totally different machine */ 55 54 return 0; 56 55 57 - imx_phycore_snd_device = platform_device_alloc("soc-audio", -1); 58 - if (!imx_phycore_snd_device) 56 + imx_phycore_snd_ac97_device = platform_device_alloc("soc-audio", -1); 57 + if (!imx_phycore_snd_ac97_device) 59 58 return -ENOMEM; 60 59 61 - platform_set_drvdata(imx_phycore_snd_device, &imx_phycore); 62 - ret = platform_device_add(imx_phycore_snd_device); 60 + platform_set_drvdata(imx_phycore_snd_ac97_device, &imx_phycore); 61 + ret = platform_device_add(imx_phycore_snd_ac97_device); 62 + if (ret) 63 + goto fail1; 63 64 64 65 imx_phycore_snd_device = platform_device_alloc("wm9712-codec", -1); 65 - if (!imx_phycore_snd_device) 66 - return -ENOMEM; 66 + if (!imx_phycore_snd_device) { 67 + ret = -ENOMEM; 68 + goto fail2; 69 + } 67 70 ret = platform_device_add(imx_phycore_snd_device); 68 71 69 72 if (ret) { 70 73 printk(KERN_ERR "ASoC: Platform device allocation failed\n"); 71 - platform_device_put(imx_phycore_snd_device); 74 + goto fail3; 72 75 } 73 76 77 + return 0; 78 + 79 + fail3: 80 + platform_device_put(imx_phycore_snd_device); 81 + fail2: 82 + platform_device_del(imx_phycore_snd_ac97_device); 83 + fail1: 84 + platform_device_put(imx_phycore_snd_ac97_device); 74 85 return ret; 75 86 } 76 87 77 88 static void __exit imx_phycore_exit(void) 78 89 { 79 90 platform_device_unregister(imx_phycore_snd_device); 91 + platform_device_unregister(imx_phycore_snd_ac97_device); 80 92 } 81 93 82 94 late_initcall(imx_phycore_init);
+1 -1
sound/soc/nuc900/nuc900-ac97.c
··· 384 384 385 385 static int __devexit nuc900_ac97_drvremove(struct platform_device *pdev) 386 386 { 387 - 388 387 snd_soc_unregister_dai(&pdev->dev); 389 388 390 389 clk_put(nuc900_ac97_data->clk); ··· 391 392 release_mem_region(nuc900_ac97_data->res->start, 392 393 resource_size(nuc900_ac97_data->res)); 393 394 395 + kfree(nuc900_ac97_data); 394 396 nuc900_ac97_data = NULL; 395 397 396 398 return 0;
+1
sound/soc/omap/omap3pandora.c
··· 306 306 pr_err(PREFIX "Failed to get DAC regulator from %s: %ld\n", 307 307 dev_name(&omap3pandora_snd_device->dev), 308 308 PTR_ERR(omap3pandora_dac_reg)); 309 + ret = PTR_ERR(omap3pandora_dac_reg); 309 310 goto fail3; 310 311 } 311 312
+8 -3
sound/soc/omap/osk5912.c
··· 177 177 tlv320aic23_mclk = clk_get(dev, "mclk"); 178 178 if (IS_ERR(tlv320aic23_mclk)) { 179 179 printk(KERN_ERR "Could not get mclk clock\n"); 180 - return -ENODEV; 180 + err = PTR_ERR(tlv320aic23_mclk); 181 + goto err2; 181 182 } 182 183 183 184 /* ··· 189 188 if (clk_set_rate(tlv320aic23_mclk, CODEC_CLOCK)) { 190 189 printk(KERN_ERR "Cannot set MCLK for AIC23 CODEC\n"); 191 190 err = -ECANCELED; 192 - goto err1; 191 + goto err3; 193 192 } 194 193 } 195 194 ··· 197 196 (uint) clk_get_rate(tlv320aic23_mclk), CODEC_CLOCK); 198 197 199 198 return 0; 200 - err1: 199 + 200 + err3: 201 201 clk_put(tlv320aic23_mclk); 202 + err2: 202 203 platform_device_del(osk_snd_device); 204 + err1: 203 205 platform_device_put(osk_snd_device); 204 206 205 207 return err; ··· 211 207 212 208 static void __exit osk_soc_exit(void) 213 209 { 210 + clk_put(tlv320aic23_mclk); 214 211 platform_device_unregister(osk_snd_device); 215 212 } 216 213
+1
sound/soc/pxa/Kconfig
··· 1 1 config SND_PXA2XX_SOC 2 2 tristate "SoC Audio for the Intel PXA2xx chip" 3 3 depends on ARCH_PXA 4 + select SND_ARM 4 5 select SND_PXA2XX_LIB 5 6 help 6 7 Say Y or M if you want to add support for codecs attached to
+2 -2
sound/soc/s3c24xx/smdk_spdif.c
··· 38 38 } 39 39 40 40 mout_epll = clk_get(NULL, "mout_epll"); 41 - if (IS_ERR(fout_epll)) { 41 + if (IS_ERR(mout_epll)) { 42 42 printk(KERN_WARNING "%s: Cannot find mout_epll.\n", 43 43 __func__); 44 44 ret = -EINVAL; ··· 54 54 } 55 55 56 56 sclk_spdif = clk_get(NULL, "sclk_spdif"); 57 - if (IS_ERR(fout_epll)) { 57 + if (IS_ERR(sclk_spdif)) { 58 58 printk(KERN_WARNING "%s: Cannot find sclk_spdif.\n", 59 59 __func__); 60 60 ret = -EINVAL;
+1 -1
sound/soc/sh/ssi.c
··· 387 387 388 388 static int __devexit sh4_soc_dai_remove(struct platform_device *pdev) 389 389 { 390 - snd_soc_unregister_dai(&pdev->dev, ARRAY_SIZE(sh4_ssi_dai)); 390 + snd_soc_unregister_dais(&pdev->dev, ARRAY_SIZE(sh4_ssi_dai)); 391 391 return 0; 392 392 } 393 393