Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'sound-4.1-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
"One nice fix is Peter's patch to make the old good SB Audigy PCI to
work with 32bit DMA instead of 31bit. This allows the MIDI synth
running on modern machines again. Along with it, a few fixes for
emu10k1 have merged.

In ASoC side, there is one fix in the common code, but it's just
trivial additions of static inline functions for CONFIG_PM=n. The
rest are various device-specific small fixes.

Last but not least, a few HD-audio fixes are included, as usual, too"

* tag 'sound-4.1-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (23 commits)
ASoC: rt5677: fixed wrong DMIC ref clock
ALSA: emu10k1: Emu10k2 32 bit DMA mode
ALSA: emux: Fix mutex deadlock in OSS emulation
ASoC: Update email-id of Rajeev Kumar
ASoC: rt5645: Fix mask for setting RT5645_DMIC_2_DP_GPIO12 bit
ALSA: hda - Fix missing va_end() call in snd_hda_codec_pcm_new()
ALSA: emux: Fix mutex deadlock at unloading
ALSA: emu10k1: Fix card shortname string buffer overflow
ALSA: hda - Add mute-LED mode control to Thinkpad
ALSA: hda - Fix mute-LED fixed mode
ALSA: hda - Fix click noise at start on Dell XPS13
ASoC: rt5645: Add ACPI match ID
ASoC: rt5677: add register patch for PLL
ASoC: Intel: fix the makefile for atom code
ASoC: dapm: Enable autodisable on SOC_DAPM_SINGLE_TLV_AUTODISABLE
ASoC: add static inline funcs to fix a compiling issue
ASoC: Intel: sst_byt: remove kfree for memory allocated with devm_kzalloc
ASoC: samsung: s3c24xx-i2s: Fix return value check in s3c24xx_iis_dev_probe()
ASoC: tfa9879: Fix return value check in tfa9879_i2c_probe()
ASoC: fsl_ssi: Fix platform_get_irq() error handling
...

+126 -69
+1 -1
include/sound/designware_i2s.h
··· 1 1 /* 2 - * Copyright (ST) 2012 Rajeev Kumar (rajeev-dlh.kumar@st.com) 2 + * Copyright (ST) 2012 Rajeev Kumar (rajeevkumar.linux@gmail.com) 3 3 * 4 4 * This program is free software; you can redistribute it and/or modify 5 5 * it under the terms of the GNU General Public License as published by
+9 -5
include/sound/emu10k1.h
··· 41 41 42 42 #define EMUPAGESIZE 4096 43 43 #define MAXREQVOICES 8 44 - #define MAXPAGES 8192 44 + #define MAXPAGES0 4096 /* 32 bit mode */ 45 + #define MAXPAGES1 8192 /* 31 bit mode */ 45 46 #define RESERVED 0 46 47 #define NUM_MIDI 16 47 48 #define NUM_G 64 /* use all channels */ ··· 51 50 52 51 /* FIXME? - according to the OSS driver the EMU10K1 needs a 29 bit DMA mask */ 53 52 #define EMU10K1_DMA_MASK 0x7fffffffUL /* 31bit */ 54 - #define AUDIGY_DMA_MASK 0x7fffffffUL /* 31bit FIXME - 32 should work? */ 55 - /* See ALSA bug #1276 - rlrevell */ 53 + #define AUDIGY_DMA_MASK 0xffffffffUL /* 32bit mode */ 56 54 57 55 #define TMEMSIZE 256*1024 58 56 #define TMEMSIZEREG 4 ··· 466 466 467 467 #define MAPB 0x0d /* Cache map B */ 468 468 469 - #define MAP_PTE_MASK 0xffffe000 /* The 19 MSBs of the PTE indexed by the PTI */ 470 - #define MAP_PTI_MASK 0x00001fff /* The 13 bit index to one of the 8192 PTE dwords */ 469 + #define MAP_PTE_MASK0 0xfffff000 /* The 20 MSBs of the PTE indexed by the PTI */ 470 + #define MAP_PTI_MASK0 0x00000fff /* The 12 bit index to one of the 4096 PTE dwords */ 471 + 472 + #define MAP_PTE_MASK1 0xffffe000 /* The 19 MSBs of the PTE indexed by the PTI */ 473 + #define MAP_PTI_MASK1 0x00001fff /* The 13 bit index to one of the 8192 PTE dwords */ 471 474 472 475 /* 0x0e, 0x0f: Not used */ 473 476 ··· 1707 1704 unsigned short model; /* subsystem id */ 1708 1705 unsigned int card_type; /* EMU10K1_CARD_* */ 1709 1706 unsigned int ecard_ctrl; /* ecard control bits */ 1707 + unsigned int address_mode; /* address mode */ 1710 1708 unsigned long dma_mask; /* PCI DMA mask */ 1711 1709 unsigned int delay_pcm_irq; /* in samples */ 1712 1710 int max_cache_pages; /* max memory size / PAGE_SIZE */
+1 -1
include/sound/soc-dapm.h
··· 287 287 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | SNDRV_CTL_ELEM_ACCESS_READWRITE,\ 288 288 .tlv.p = (tlv_array), \ 289 289 .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ 290 - .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert, 0) } 290 + .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert, 1) } 291 291 #define SOC_DAPM_SINGLE_TLV_VIRT(xname, max, tlv_array) \ 292 292 SOC_DAPM_SINGLE(xname, SND_SOC_NOPM, 0, max, 0, tlv_array) 293 293 #define SOC_DAPM_ENUM(xname, xenum) \
+12
include/sound/soc.h
··· 387 387 int snd_soc_register_card(struct snd_soc_card *card); 388 388 int snd_soc_unregister_card(struct snd_soc_card *card); 389 389 int devm_snd_soc_register_card(struct device *dev, struct snd_soc_card *card); 390 + #ifdef CONFIG_PM_SLEEP 390 391 int snd_soc_suspend(struct device *dev); 391 392 int snd_soc_resume(struct device *dev); 393 + #else 394 + static inline int snd_soc_suspend(struct device *dev) 395 + { 396 + return 0; 397 + } 398 + 399 + static inline int snd_soc_resume(struct device *dev) 400 + { 401 + return 0; 402 + } 403 + #endif 392 404 int snd_soc_poweroff(struct device *dev); 393 405 int snd_soc_register_platform(struct device *dev, 394 406 const struct snd_soc_platform_driver *platform_drv);
+1 -1
include/sound/spear_dma.h
··· 1 1 /* 2 2 * linux/spear_dma.h 3 3 * 4 - * Copyright (ST) 2012 Rajeev Kumar (rajeev-dlh.kumar@st.com) 4 + * Copyright (ST) 2012 Rajeev Kumar (rajeevkumar.linux@gmail.com) 5 5 * 6 6 * This program is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by
+4 -2
sound/pci/emu10k1/emu10k1.c
··· 183 183 } 184 184 #endif 185 185 186 - strcpy(card->driver, emu->card_capabilities->driver); 187 - strcpy(card->shortname, emu->card_capabilities->name); 186 + strlcpy(card->driver, emu->card_capabilities->driver, 187 + sizeof(card->driver)); 188 + strlcpy(card->shortname, emu->card_capabilities->name, 189 + sizeof(card->shortname)); 188 190 snprintf(card->longname, sizeof(card->longname), 189 191 "%s (rev.%d, serial:0x%x) at 0x%lx, irq %i", 190 192 card->shortname, emu->revision, emu->serial, emu->port, emu->irq);
+2 -2
sound/pci/emu10k1/emu10k1_callback.c
··· 415 415 snd_emu10k1_ptr_write(hw, Z2, ch, 0); 416 416 417 417 /* invalidate maps */ 418 - temp = (hw->silent_page.addr << 1) | MAP_PTI_MASK; 418 + temp = (hw->silent_page.addr << hw->address_mode) | (hw->address_mode ? MAP_PTI_MASK1 : MAP_PTI_MASK0); 419 419 snd_emu10k1_ptr_write(hw, MAPA, ch, temp); 420 420 snd_emu10k1_ptr_write(hw, MAPB, ch, temp); 421 421 #if 0 ··· 436 436 snd_emu10k1_ptr_write(hw, CDF, ch, sample); 437 437 438 438 /* invalidate maps */ 439 - temp = ((unsigned int)hw->silent_page.addr << 1) | MAP_PTI_MASK; 439 + temp = ((unsigned int)hw->silent_page.addr << hw_address_mode) | (hw->address_mode ? MAP_PTI_MASK1 : MAP_PTI_MASK0); 440 440 snd_emu10k1_ptr_write(hw, MAPA, ch, temp); 441 441 snd_emu10k1_ptr_write(hw, MAPB, ch, temp); 442 442
+14 -7
sound/pci/emu10k1/emu10k1_main.c
··· 282 282 snd_emu10k1_ptr_write(emu, TCB, 0, 0); /* taken from original driver */ 283 283 snd_emu10k1_ptr_write(emu, TCBS, 0, 4); /* taken from original driver */ 284 284 285 - silent_page = (emu->silent_page.addr << 1) | MAP_PTI_MASK; 285 + silent_page = (emu->silent_page.addr << emu->address_mode) | (emu->address_mode ? MAP_PTI_MASK1 : MAP_PTI_MASK0); 286 286 for (ch = 0; ch < NUM_G; ch++) { 287 287 snd_emu10k1_ptr_write(emu, MAPA, ch, silent_page); 288 288 snd_emu10k1_ptr_write(emu, MAPB, ch, silent_page); ··· 346 346 } else if (emu->audigy) { /* enable analog output */ 347 347 unsigned int reg = inl(emu->port + A_IOCFG); 348 348 outl(reg | A_IOCFG_GPOUT0, emu->port + A_IOCFG); 349 + } 350 + 351 + if (emu->address_mode == 0) { 352 + /* use 16M in 4G */ 353 + outl(inl(emu->port + HCFG) | HCFG_EXPANDED_MEM, emu->port + HCFG); 349 354 } 350 355 351 356 return 0; ··· 1451 1446 * 1452 1447 */ 1453 1448 {.vendor = 0x1102, .device = 0x0008, .subsystem = 0x20011102, 1454 - .driver = "Audigy2", .name = "SB Audigy 2 ZS Notebook [SB0530]", 1449 + .driver = "Audigy2", .name = "Audigy 2 ZS Notebook [SB0530]", 1455 1450 .id = "Audigy2", 1456 1451 .emu10k2_chip = 1, 1457 1452 .ca0108_chip = 1, ··· 1601 1596 .adc_1361t = 1, /* 24 bit capture instead of 16bit */ 1602 1597 .ac97_chip = 1} , 1603 1598 {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x10051102, 1604 - .driver = "Audigy2", .name = "SB Audigy 2 Platinum EX [SB0280]", 1599 + .driver = "Audigy2", .name = "Audigy 2 Platinum EX [SB0280]", 1605 1600 .id = "Audigy2", 1606 1601 .emu10k2_chip = 1, 1607 1602 .ca0102_chip = 1, ··· 1907 1902 1908 1903 is_audigy = emu->audigy = c->emu10k2_chip; 1909 1904 1905 + /* set addressing mode */ 1906 + emu->address_mode = is_audigy ? 0 : 1; 1910 1907 /* set the DMA transfer mask */ 1911 - emu->dma_mask = is_audigy ? AUDIGY_DMA_MASK : EMU10K1_DMA_MASK; 1908 + emu->dma_mask = emu->address_mode ? EMU10K1_DMA_MASK : AUDIGY_DMA_MASK; 1912 1909 if (pci_set_dma_mask(pci, emu->dma_mask) < 0 || 1913 1910 pci_set_consistent_dma_mask(pci, emu->dma_mask) < 0) { 1914 1911 dev_err(card->dev, ··· 1935 1928 1936 1929 emu->max_cache_pages = max_cache_bytes >> PAGE_SHIFT; 1937 1930 if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(pci), 1938 - 32 * 1024, &emu->ptb_pages) < 0) { 1931 + (emu->address_mode ? 32 : 16) * 1024, &emu->ptb_pages) < 0) { 1939 1932 err = -ENOMEM; 1940 1933 goto error; 1941 1934 } ··· 2034 2027 2035 2028 /* Clear silent pages and set up pointers */ 2036 2029 memset(emu->silent_page.area, 0, PAGE_SIZE); 2037 - silent_page = emu->silent_page.addr << 1; 2038 - for (idx = 0; idx < MAXPAGES; idx++) 2030 + silent_page = emu->silent_page.addr << emu->address_mode; 2031 + for (idx = 0; idx < (emu->address_mode ? MAXPAGES1 : MAXPAGES0); idx++) 2039 2032 ((u32 *)emu->ptb_pages.area)[idx] = cpu_to_le32(silent_page | idx); 2040 2033 2041 2034 /* set up voice indices */
+1 -1
sound/pci/emu10k1/emupcm.c
··· 380 380 snd_emu10k1_ptr_write(emu, Z1, voice, 0); 381 381 snd_emu10k1_ptr_write(emu, Z2, voice, 0); 382 382 /* invalidate maps */ 383 - silent_page = ((unsigned int)emu->silent_page.addr << 1) | MAP_PTI_MASK; 383 + silent_page = ((unsigned int)emu->silent_page.addr << emu->address_mode) | (emu->address_mode ? MAP_PTI_MASK1 : MAP_PTI_MASK0); 384 384 snd_emu10k1_ptr_write(emu, MAPA, voice, silent_page); 385 385 snd_emu10k1_ptr_write(emu, MAPB, voice, silent_page); 386 386 /* modulation envelope */
+6 -5
sound/pci/emu10k1/memory.c
··· 34 34 * aligned pages in others 35 35 */ 36 36 #define __set_ptb_entry(emu,page,addr) \ 37 - (((u32 *)(emu)->ptb_pages.area)[page] = cpu_to_le32(((addr) << 1) | (page))) 37 + (((u32 *)(emu)->ptb_pages.area)[page] = cpu_to_le32(((addr) << (emu->address_mode)) | (page))) 38 38 39 39 #define UNIT_PAGES (PAGE_SIZE / EMUPAGESIZE) 40 - #define MAX_ALIGN_PAGES (MAXPAGES / UNIT_PAGES) 40 + #define MAX_ALIGN_PAGES0 (MAXPAGES0 / UNIT_PAGES) 41 + #define MAX_ALIGN_PAGES1 (MAXPAGES1 / UNIT_PAGES) 41 42 /* get aligned page from offset address */ 42 43 #define get_aligned_page(offset) ((offset) >> PAGE_SHIFT) 43 44 /* get offset address from aligned page */ ··· 125 124 } 126 125 page = blk->mapped_page + blk->pages; 127 126 } 128 - size = MAX_ALIGN_PAGES - page; 127 + size = (emu->address_mode ? MAX_ALIGN_PAGES1 : MAX_ALIGN_PAGES0) - page; 129 128 if (size >= max_size) { 130 129 *nextp = pos; 131 130 return page; ··· 182 181 q = get_emu10k1_memblk(p, mapped_link); 183 182 end_page = q->mapped_page; 184 183 } else 185 - end_page = MAX_ALIGN_PAGES; 184 + end_page = (emu->address_mode ? MAX_ALIGN_PAGES1 : MAX_ALIGN_PAGES0); 186 185 187 186 /* remove links */ 188 187 list_del(&blk->mapped_link); ··· 308 307 if (snd_BUG_ON(!emu)) 309 308 return NULL; 310 309 if (snd_BUG_ON(runtime->dma_bytes <= 0 || 311 - runtime->dma_bytes >= MAXPAGES * EMUPAGESIZE)) 310 + runtime->dma_bytes >= (emu->address_mode ? MAXPAGES1 : MAXPAGES0) * EMUPAGESIZE)) 312 311 return NULL; 313 312 hdr = emu->memhdr; 314 313 if (snd_BUG_ON(!hdr))
+14 -10
sound/pci/hda/hda_codec.c
··· 873 873 struct hda_pcm *pcm; 874 874 va_list args; 875 875 876 - va_start(args, fmt); 877 876 pcm = kzalloc(sizeof(*pcm), GFP_KERNEL); 878 877 if (!pcm) 879 878 return NULL; 880 879 881 880 pcm->codec = codec; 882 881 kref_init(&pcm->kref); 882 + va_start(args, fmt); 883 883 pcm->name = kvasprintf(GFP_KERNEL, fmt, args); 884 + va_end(args); 884 885 if (!pcm->name) { 885 886 kfree(pcm); 886 887 return NULL; ··· 2083 2082 .put = vmaster_mute_mode_put, 2084 2083 }; 2085 2084 2085 + /* meta hook to call each driver's vmaster hook */ 2086 + static void vmaster_hook(void *private_data, int enabled) 2087 + { 2088 + struct hda_vmaster_mute_hook *hook = private_data; 2089 + 2090 + if (hook->mute_mode != HDA_VMUTE_FOLLOW_MASTER) 2091 + enabled = hook->mute_mode; 2092 + hook->hook(hook->codec, enabled); 2093 + } 2094 + 2086 2095 /** 2087 2096 * snd_hda_add_vmaster_hook - Add a vmaster hook for mute-LED 2088 2097 * @codec: the HDA codec ··· 2111 2100 2112 2101 if (!hook->hook || !hook->sw_kctl) 2113 2102 return 0; 2114 - snd_ctl_add_vmaster_hook(hook->sw_kctl, hook->hook, codec); 2115 2103 hook->codec = codec; 2116 2104 hook->mute_mode = HDA_VMUTE_FOLLOW_MASTER; 2105 + snd_ctl_add_vmaster_hook(hook->sw_kctl, vmaster_hook, hook); 2117 2106 if (!expose_enum_ctl) 2118 2107 return 0; 2119 2108 kctl = snd_ctl_new1(&vmaster_mute_mode, hook); ··· 2139 2128 */ 2140 2129 if (hook->codec->bus->shutdown) 2141 2130 return; 2142 - switch (hook->mute_mode) { 2143 - case HDA_VMUTE_FOLLOW_MASTER: 2144 - snd_ctl_sync_vmaster_hook(hook->sw_kctl); 2145 - break; 2146 - default: 2147 - hook->hook(hook->codec, hook->mute_mode); 2148 - break; 2149 - } 2131 + snd_ctl_sync_vmaster_hook(hook->sw_kctl); 2150 2132 } 2151 2133 EXPORT_SYMBOL_GPL(snd_hda_sync_vmaster_hook); 2152 2134
+2 -1
sound/pci/hda/hda_generic.c
··· 3259 3259 val = PIN_IN; 3260 3260 if (cfg->inputs[i].type == AUTO_PIN_MIC) 3261 3261 val |= snd_hda_get_default_vref(codec, pin); 3262 - if (pin != spec->hp_mic_pin) 3262 + if (pin != spec->hp_mic_pin && 3263 + !snd_hda_codec_get_pin_target(codec, pin)) 3263 3264 set_pin_target(codec, pin, val, false); 3264 3265 3265 3266 if (mixer) {
+12 -4
sound/pci/hda/patch_realtek.c
··· 4190 4190 static void alc_fixup_dell_xps13(struct hda_codec *codec, 4191 4191 const struct hda_fixup *fix, int action) 4192 4192 { 4193 - if (action == HDA_FIXUP_ACT_PROBE) { 4194 - struct alc_spec *spec = codec->spec; 4195 - struct hda_input_mux *imux = &spec->gen.input_mux; 4196 - int i; 4193 + struct alc_spec *spec = codec->spec; 4194 + struct hda_input_mux *imux = &spec->gen.input_mux; 4195 + int i; 4197 4196 4197 + switch (action) { 4198 + case HDA_FIXUP_ACT_PRE_PROBE: 4199 + /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise 4200 + * it causes a click noise at start up 4201 + */ 4202 + snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ); 4203 + break; 4204 + case HDA_FIXUP_ACT_PROBE: 4198 4205 spec->shutup = alc_shutup_dell_xps13; 4199 4206 4200 4207 /* Make the internal mic the default input source. */ ··· 4211 4204 break; 4212 4205 } 4213 4206 } 4207 + break; 4214 4208 } 4215 4209 } 4216 4210
+1
sound/pci/hda/thinkpad_helper.c
··· 72 72 if (led_set_func(TPACPI_LED_MUTE, false) >= 0) { 73 73 old_vmaster_hook = spec->vmaster_mute.hook; 74 74 spec->vmaster_mute.hook = update_tpacpi_mute_led; 75 + spec->vmaster_mute_enum = 1; 75 76 removefunc = false; 76 77 } 77 78 if (led_set_func(TPACPI_LED_MICMUTE, false) >= 0) {
+12 -1
sound/soc/codecs/rt5645.c
··· 18 18 #include <linux/platform_device.h> 19 19 #include <linux/spi/spi.h> 20 20 #include <linux/gpio.h> 21 + #include <linux/acpi.h> 21 22 #include <sound/core.h> 22 23 #include <sound/pcm.h> 23 24 #include <sound/pcm_params.h> ··· 2657 2656 }; 2658 2657 MODULE_DEVICE_TABLE(i2c, rt5645_i2c_id); 2659 2658 2659 + #ifdef CONFIG_ACPI 2660 + static struct acpi_device_id rt5645_acpi_match[] = { 2661 + { "10EC5645", 0 }, 2662 + { "10EC5650", 0 }, 2663 + {}, 2664 + }; 2665 + MODULE_DEVICE_TABLE(acpi, rt5645_acpi_match); 2666 + #endif 2667 + 2660 2668 static int rt5645_i2c_probe(struct i2c_client *i2c, 2661 2669 const struct i2c_device_id *id) 2662 2670 { ··· 2780 2770 2781 2771 case RT5645_DMIC_DATA_GPIO12: 2782 2772 regmap_update_bits(rt5645->regmap, RT5645_DMIC_CTRL1, 2783 - RT5645_DMIC_1_DP_MASK, RT5645_DMIC_2_DP_GPIO12); 2773 + RT5645_DMIC_2_DP_MASK, RT5645_DMIC_2_DP_GPIO12); 2784 2774 regmap_update_bits(rt5645->regmap, RT5645_GPIO_CTRL1, 2785 2775 RT5645_GP12_PIN_MASK, 2786 2776 RT5645_GP12_PIN_DMIC2_SDA); ··· 2882 2872 .driver = { 2883 2873 .name = "rt5645", 2884 2874 .owner = THIS_MODULE, 2875 + .acpi_match_table = ACPI_PTR(rt5645_acpi_match), 2885 2876 }, 2886 2877 .probe = rt5645_i2c_probe, 2887 2878 .remove = rt5645_i2c_remove,
+4 -1
sound/soc/codecs/rt5677.c
··· 62 62 {RT5677_PR_BASE + 0x1e, 0x0000}, 63 63 {RT5677_PR_BASE + 0x12, 0x0eaa}, 64 64 {RT5677_PR_BASE + 0x14, 0x018a}, 65 + {RT5677_PR_BASE + 0x15, 0x0490}, 66 + {RT5677_PR_BASE + 0x38, 0x0f71}, 67 + {RT5677_PR_BASE + 0x39, 0x0f71}, 65 68 }; 66 69 #define RT5677_INIT_REG_LEN ARRAY_SIZE(init_list) 67 70 ··· 917 914 { 918 915 struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); 919 916 struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec); 920 - int idx = rl6231_calc_dmic_clk(rt5677->sysclk); 917 + int idx = rl6231_calc_dmic_clk(rt5677->lrck[RT5677_AIF1] << 8); 921 918 922 919 if (idx < 0) 923 920 dev_err(codec->dev, "Failed to set DMIC clock\n");
+2 -2
sound/soc/codecs/tfa9879.c
··· 280 280 int i; 281 281 282 282 tfa9879 = devm_kzalloc(&i2c->dev, sizeof(*tfa9879), GFP_KERNEL); 283 - if (IS_ERR(tfa9879)) 284 - return PTR_ERR(tfa9879); 283 + if (!tfa9879) 284 + return -ENOMEM; 285 285 286 286 i2c_set_clientdata(i2c, tfa9879); 287 287
+1 -1
sound/soc/fsl/fsl_ssi.c
··· 1357 1357 } 1358 1358 1359 1359 ssi_private->irq = platform_get_irq(pdev, 0); 1360 - if (!ssi_private->irq) { 1360 + if (ssi_private->irq < 0) { 1361 1361 dev_err(&pdev->dev, "no irq for node %s\n", pdev->name); 1362 1362 return ssi_private->irq; 1363 1363 }
+1 -1
sound/soc/intel/Makefile
··· 4 4 # Platform Support 5 5 obj-$(CONFIG_SND_SOC_INTEL_HASWELL) += haswell/ 6 6 obj-$(CONFIG_SND_SOC_INTEL_BAYTRAIL) += baytrail/ 7 - obj-$(CONFIG_SND_SOC_INTEL_BAYTRAIL) += atom/ 7 + obj-$(CONFIG_SND_SST_MFLD_PLATFORM) += atom/ 8 8 9 9 # Machine support 10 10 obj-$(CONFIG_SND_SOC_INTEL_SST) += boards/
-1
sound/soc/intel/baytrail/sst-baytrail-ipc.c
··· 759 759 dsp_new_err: 760 760 sst_ipc_fini(ipc); 761 761 ipc_init_err: 762 - kfree(byt); 763 762 764 763 return err; 765 764 }
-1
sound/soc/intel/haswell/sst-haswell-ipc.c
··· 2201 2201 dsp_new_err: 2202 2202 sst_ipc_fini(ipc); 2203 2203 ipc_init_err: 2204 - kfree(hsw); 2205 2204 return ret; 2206 2205 } 2207 2206 EXPORT_SYMBOL_GPL(sst_hsw_dsp_init);
+1 -1
sound/soc/qcom/lpass-cpu.c
··· 194 194 int cmd, struct snd_soc_dai *dai) 195 195 { 196 196 struct lpass_data *drvdata = snd_soc_dai_get_drvdata(dai); 197 - int ret; 197 + int ret = -EINVAL; 198 198 199 199 switch (cmd) { 200 200 case SNDRV_PCM_TRIGGER_START:
+2 -2
sound/soc/samsung/s3c24xx-i2s.c
··· 461 461 return -ENOENT; 462 462 } 463 463 s3c24xx_i2s.regs = devm_ioremap_resource(&pdev->dev, res); 464 - if (s3c24xx_i2s.regs == NULL) 465 - return -ENXIO; 464 + if (IS_ERR(s3c24xx_i2s.regs)) 465 + return PTR_ERR(s3c24xx_i2s.regs); 466 466 467 467 s3c24xx_i2s_pcm_stereo_out.dma_addr = res->start + S3C2410_IISFIFO; 468 468 s3c24xx_i2s_pcm_stereo_in.dma_addr = res->start + S3C2410_IISFIFO;
+1
sound/soc/sh/rcar/dma.c
··· 156 156 (void *)id); 157 157 } 158 158 if (IS_ERR_OR_NULL(dmaen->chan)) { 159 + dmaen->chan = NULL; 159 160 dev_err(dev, "can't get dma channel\n"); 160 161 goto rsnd_dma_channel_err; 161 162 }
+1 -10
sound/synth/emux/emux_oss.c
··· 118 118 if (snd_BUG_ON(!arg || !emu)) 119 119 return -ENXIO; 120 120 121 - mutex_lock(&emu->register_mutex); 122 - 123 - if (!snd_emux_inc_count(emu)) { 124 - mutex_unlock(&emu->register_mutex); 121 + if (!snd_emux_inc_count(emu)) 125 122 return -EFAULT; 126 - } 127 123 128 124 memset(&callback, 0, sizeof(callback)); 129 125 callback.owner = THIS_MODULE; ··· 131 135 if (p == NULL) { 132 136 snd_printk(KERN_ERR "can't create port\n"); 133 137 snd_emux_dec_count(emu); 134 - mutex_unlock(&emu->register_mutex); 135 138 return -ENOMEM; 136 139 } 137 140 ··· 143 148 reset_port_mode(p, arg->seq_mode); 144 149 145 150 snd_emux_reset_port(p); 146 - 147 - mutex_unlock(&emu->register_mutex); 148 151 return 0; 149 152 } 150 153 ··· 188 195 if (snd_BUG_ON(!emu)) 189 196 return -ENXIO; 190 197 191 - mutex_lock(&emu->register_mutex); 192 198 snd_emux_sounds_off_all(p); 193 199 snd_soundfont_close_check(emu->sflist, SF_CLIENT_NO(p->chset.port)); 194 200 snd_seq_event_port_detach(p->chset.client, p->chset.port); 195 201 snd_emux_dec_count(emu); 196 202 197 - mutex_unlock(&emu->register_mutex); 198 203 return 0; 199 204 } 200 205
+21 -8
sound/synth/emux/emux_seq.c
··· 124 124 if (emu->voices) 125 125 snd_emux_terminate_all(emu); 126 126 127 - mutex_lock(&emu->register_mutex); 128 127 if (emu->client >= 0) { 129 128 snd_seq_delete_kernel_client(emu->client); 130 129 emu->client = -1; 131 130 } 132 - mutex_unlock(&emu->register_mutex); 133 131 } 134 132 135 133 ··· 267 269 /* 268 270 * increment usage count 269 271 */ 270 - int 271 - snd_emux_inc_count(struct snd_emux *emu) 272 + static int 273 + __snd_emux_inc_count(struct snd_emux *emu) 272 274 { 273 275 emu->used++; 274 276 if (!try_module_get(emu->ops.owner)) ··· 282 284 return 1; 283 285 } 284 286 287 + int snd_emux_inc_count(struct snd_emux *emu) 288 + { 289 + int ret; 290 + 291 + mutex_lock(&emu->register_mutex); 292 + ret = __snd_emux_inc_count(emu); 293 + mutex_unlock(&emu->register_mutex); 294 + return ret; 295 + } 285 296 286 297 /* 287 298 * decrease usage count 288 299 */ 289 - void 290 - snd_emux_dec_count(struct snd_emux *emu) 300 + static void 301 + __snd_emux_dec_count(struct snd_emux *emu) 291 302 { 292 303 module_put(emu->card->module); 293 304 emu->used--; ··· 305 298 module_put(emu->ops.owner); 306 299 } 307 300 301 + void snd_emux_dec_count(struct snd_emux *emu) 302 + { 303 + mutex_lock(&emu->register_mutex); 304 + __snd_emux_dec_count(emu); 305 + mutex_unlock(&emu->register_mutex); 306 + } 308 307 309 308 /* 310 309 * Routine that is called upon a first use of a particular port ··· 330 317 331 318 mutex_lock(&emu->register_mutex); 332 319 snd_emux_init_port(p); 333 - snd_emux_inc_count(emu); 320 + __snd_emux_inc_count(emu); 334 321 mutex_unlock(&emu->register_mutex); 335 322 return 0; 336 323 } ··· 353 340 354 341 mutex_lock(&emu->register_mutex); 355 342 snd_emux_sounds_off_all(p); 356 - snd_emux_dec_count(emu); 343 + __snd_emux_dec_count(emu); 357 344 mutex_unlock(&emu->register_mutex); 358 345 return 0; 359 346 }