diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/pci/fm801.c | 15 | ||||
-rw-r--r-- | sound/pci/hda/hda_intel.c | 9 | ||||
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 8 | ||||
-rw-r--r-- | sound/pci/hda/patch_sigmatel.c | 1 | ||||
-rw-r--r-- | sound/soc/blackfin/bf5xx-ad73311.c | 2 | ||||
-rw-r--r-- | sound/soc/codecs/ssm2602.c | 3 | ||||
-rw-r--r-- | sound/soc/codecs/wm8753.c | 4 | ||||
-rw-r--r-- | sound/soc/codecs/wm8962.c | 26 | ||||
-rw-r--r-- | sound/soc/omap/mcpdm.c | 2 | ||||
-rw-r--r-- | sound/soc/omap/mcpdm.h | 2 | ||||
-rw-r--r-- | sound/soc/omap/omap-mcbsp.c | 6 | ||||
-rw-r--r-- | sound/soc/pxa/zylonite.c | 8 | ||||
-rw-r--r-- | sound/soc/soc-core.c | 18 | ||||
-rw-r--r-- | sound/usb/card.c | 7 |
14 files changed, 60 insertions, 51 deletions
diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c index f9123f09e83..32b02d90670 100644 --- a/sound/pci/fm801.c +++ b/sound/pci/fm801.c | |||
@@ -68,6 +68,7 @@ MODULE_PARM_DESC(enable, "Enable FM801 soundcard."); | |||
68 | module_param_array(tea575x_tuner, int, NULL, 0444); | 68 | module_param_array(tea575x_tuner, int, NULL, 0444); |
69 | MODULE_PARM_DESC(tea575x_tuner, "TEA575x tuner access method (0 = auto, 1 = SF256-PCS, 2=SF256-PCP, 3=SF64-PCR, 8=disable, +16=tuner-only)."); | 69 | MODULE_PARM_DESC(tea575x_tuner, "TEA575x tuner access method (0 = auto, 1 = SF256-PCS, 2=SF256-PCP, 3=SF64-PCR, 8=disable, +16=tuner-only)."); |
70 | 70 | ||
71 | #define TUNER_DISABLED (1<<3) | ||
71 | #define TUNER_ONLY (1<<4) | 72 | #define TUNER_ONLY (1<<4) |
72 | #define TUNER_TYPE_MASK (~TUNER_ONLY & 0xFFFF) | 73 | #define TUNER_TYPE_MASK (~TUNER_ONLY & 0xFFFF) |
73 | 74 | ||
@@ -1150,7 +1151,8 @@ static int snd_fm801_free(struct fm801 *chip) | |||
1150 | 1151 | ||
1151 | __end_hw: | 1152 | __end_hw: |
1152 | #ifdef CONFIG_SND_FM801_TEA575X_BOOL | 1153 | #ifdef CONFIG_SND_FM801_TEA575X_BOOL |
1153 | snd_tea575x_exit(&chip->tea); | 1154 | if (!(chip->tea575x_tuner & TUNER_DISABLED)) |
1155 | snd_tea575x_exit(&chip->tea); | ||
1154 | #endif | 1156 | #endif |
1155 | if (chip->irq >= 0) | 1157 | if (chip->irq >= 0) |
1156 | free_irq(chip->irq, chip); | 1158 | free_irq(chip->irq, chip); |
@@ -1236,7 +1238,6 @@ static int __devinit snd_fm801_create(struct snd_card *card, | |||
1236 | (tea575x_tuner & TUNER_TYPE_MASK) < 4) { | 1238 | (tea575x_tuner & TUNER_TYPE_MASK) < 4) { |
1237 | if (snd_tea575x_init(&chip->tea)) { | 1239 | if (snd_tea575x_init(&chip->tea)) { |
1238 | snd_printk(KERN_ERR "TEA575x radio not found\n"); | 1240 | snd_printk(KERN_ERR "TEA575x radio not found\n"); |
1239 | snd_fm801_free(chip); | ||
1240 | return -ENODEV; | 1241 | return -ENODEV; |
1241 | } | 1242 | } |
1242 | } else if ((tea575x_tuner & TUNER_TYPE_MASK) == 0) { | 1243 | } else if ((tea575x_tuner & TUNER_TYPE_MASK) == 0) { |
@@ -1251,11 +1252,15 @@ static int __devinit snd_fm801_create(struct snd_card *card, | |||
1251 | } | 1252 | } |
1252 | if (tea575x_tuner == 4) { | 1253 | if (tea575x_tuner == 4) { |
1253 | snd_printk(KERN_ERR "TEA575x radio not found\n"); | 1254 | snd_printk(KERN_ERR "TEA575x radio not found\n"); |
1254 | snd_fm801_free(chip); | 1255 | chip->tea575x_tuner = TUNER_DISABLED; |
1255 | return -ENODEV; | ||
1256 | } | 1256 | } |
1257 | } | 1257 | } |
1258 | strlcpy(chip->tea.card, snd_fm801_tea575x_gpios[(tea575x_tuner & TUNER_TYPE_MASK) - 1].name, sizeof(chip->tea.card)); | 1258 | if (!(chip->tea575x_tuner & TUNER_DISABLED)) { |
1259 | strlcpy(chip->tea.card, | ||
1260 | snd_fm801_tea575x_gpios[(tea575x_tuner & | ||
1261 | TUNER_TYPE_MASK) - 1].name, | ||
1262 | sizeof(chip->tea.card)); | ||
1263 | } | ||
1259 | #endif | 1264 | #endif |
1260 | 1265 | ||
1261 | *rchip = chip; | 1266 | *rchip = chip; |
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index be6982289c0..e9a2a8795d1 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
@@ -1924,7 +1924,8 @@ static unsigned int azx_via_get_position(struct azx *chip, | |||
1924 | } | 1924 | } |
1925 | 1925 | ||
1926 | static unsigned int azx_get_position(struct azx *chip, | 1926 | static unsigned int azx_get_position(struct azx *chip, |
1927 | struct azx_dev *azx_dev) | 1927 | struct azx_dev *azx_dev, |
1928 | bool with_check) | ||
1928 | { | 1929 | { |
1929 | unsigned int pos; | 1930 | unsigned int pos; |
1930 | int stream = azx_dev->substream->stream; | 1931 | int stream = azx_dev->substream->stream; |
@@ -1940,7 +1941,7 @@ static unsigned int azx_get_position(struct azx *chip, | |||
1940 | default: | 1941 | default: |
1941 | /* use the position buffer */ | 1942 | /* use the position buffer */ |
1942 | pos = le32_to_cpu(*azx_dev->posbuf); | 1943 | pos = le32_to_cpu(*azx_dev->posbuf); |
1943 | if (chip->position_fix[stream] == POS_FIX_AUTO) { | 1944 | if (with_check && chip->position_fix[stream] == POS_FIX_AUTO) { |
1944 | if (!pos || pos == (u32)-1) { | 1945 | if (!pos || pos == (u32)-1) { |
1945 | printk(KERN_WARNING | 1946 | printk(KERN_WARNING |
1946 | "hda-intel: Invalid position buffer, " | 1947 | "hda-intel: Invalid position buffer, " |
@@ -1964,7 +1965,7 @@ static snd_pcm_uframes_t azx_pcm_pointer(struct snd_pcm_substream *substream) | |||
1964 | struct azx *chip = apcm->chip; | 1965 | struct azx *chip = apcm->chip; |
1965 | struct azx_dev *azx_dev = get_azx_dev(substream); | 1966 | struct azx_dev *azx_dev = get_azx_dev(substream); |
1966 | return bytes_to_frames(substream->runtime, | 1967 | return bytes_to_frames(substream->runtime, |
1967 | azx_get_position(chip, azx_dev)); | 1968 | azx_get_position(chip, azx_dev, false)); |
1968 | } | 1969 | } |
1969 | 1970 | ||
1970 | /* | 1971 | /* |
@@ -1987,7 +1988,7 @@ static int azx_position_ok(struct azx *chip, struct azx_dev *azx_dev) | |||
1987 | return -1; /* bogus (too early) interrupt */ | 1988 | return -1; /* bogus (too early) interrupt */ |
1988 | 1989 | ||
1989 | stream = azx_dev->substream->stream; | 1990 | stream = azx_dev->substream->stream; |
1990 | pos = azx_get_position(chip, azx_dev); | 1991 | pos = azx_get_position(chip, azx_dev, true); |
1991 | 1992 | ||
1992 | if (WARN_ONCE(!azx_dev->period_bytes, | 1993 | if (WARN_ONCE(!azx_dev->period_bytes, |
1993 | "hda-intel: zero azx_dev->period_bytes")) | 1994 | "hda-intel: zero azx_dev->period_bytes")) |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 0503c999e7d..7a73621a890 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -578,6 +578,10 @@ static void alc_line_automute(struct hda_codec *codec) | |||
578 | { | 578 | { |
579 | struct alc_spec *spec = codec->spec; | 579 | struct alc_spec *spec = codec->spec; |
580 | 580 | ||
581 | /* check LO jack only when it's different from HP */ | ||
582 | if (spec->autocfg.line_out_pins[0] == spec->autocfg.hp_pins[0]) | ||
583 | return; | ||
584 | |||
581 | spec->line_jack_present = | 585 | spec->line_jack_present = |
582 | detect_jacks(codec, ARRAY_SIZE(spec->autocfg.line_out_pins), | 586 | detect_jacks(codec, ARRAY_SIZE(spec->autocfg.line_out_pins), |
583 | spec->autocfg.line_out_pins); | 587 | spec->autocfg.line_out_pins); |
@@ -1321,7 +1325,9 @@ do_sku: | |||
1321 | * 15 : 1 --> enable the function "Mute internal speaker | 1325 | * 15 : 1 --> enable the function "Mute internal speaker |
1322 | * when the external headphone out jack is plugged" | 1326 | * when the external headphone out jack is plugged" |
1323 | */ | 1327 | */ |
1324 | if (!spec->autocfg.hp_pins[0]) { | 1328 | if (!spec->autocfg.hp_pins[0] && |
1329 | !(spec->autocfg.line_out_pins[0] && | ||
1330 | spec->autocfg.line_out_type == AUTO_PIN_HP_OUT)) { | ||
1325 | hda_nid_t nid; | 1331 | hda_nid_t nid; |
1326 | tmp = (ass >> 11) & 0x3; /* HP to chassis */ | 1332 | tmp = (ass >> 11) & 0x3; /* HP to chassis */ |
1327 | if (tmp == 0) | 1333 | if (tmp == 0) |
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 1b7c11432aa..987e3cf71a0 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -5630,6 +5630,7 @@ again: | |||
5630 | switch (codec->vendor_id) { | 5630 | switch (codec->vendor_id) { |
5631 | case 0x111d76d1: | 5631 | case 0x111d76d1: |
5632 | case 0x111d76d9: | 5632 | case 0x111d76d9: |
5633 | case 0x111d76df: | ||
5633 | case 0x111d76e5: | 5634 | case 0x111d76e5: |
5634 | case 0x111d7666: | 5635 | case 0x111d7666: |
5635 | case 0x111d7667: | 5636 | case 0x111d7667: |
diff --git a/sound/soc/blackfin/bf5xx-ad73311.c b/sound/soc/blackfin/bf5xx-ad73311.c index 732a247f252..b94eb7ef7d1 100644 --- a/sound/soc/blackfin/bf5xx-ad73311.c +++ b/sound/soc/blackfin/bf5xx-ad73311.c | |||
@@ -128,7 +128,7 @@ static int snd_ad73311_configure(void) | |||
128 | return 0; | 128 | return 0; |
129 | } | 129 | } |
130 | 130 | ||
131 | static int bf5xx_probe(struct platform_device *pdev) | 131 | static int bf5xx_probe(struct snd_soc_card *card) |
132 | { | 132 | { |
133 | int err; | 133 | int err; |
134 | if (gpio_request(GPIO_SE, "AD73311_SE")) { | 134 | if (gpio_request(GPIO_SE, "AD73311_SE")) { |
diff --git a/sound/soc/codecs/ssm2602.c b/sound/soc/codecs/ssm2602.c index 84f4ad56855..9801cd7cfcb 100644 --- a/sound/soc/codecs/ssm2602.c +++ b/sound/soc/codecs/ssm2602.c | |||
@@ -431,7 +431,8 @@ static int ssm2602_set_dai_fmt(struct snd_soc_dai *codec_dai, | |||
431 | static int ssm2602_set_bias_level(struct snd_soc_codec *codec, | 431 | static int ssm2602_set_bias_level(struct snd_soc_codec *codec, |
432 | enum snd_soc_bias_level level) | 432 | enum snd_soc_bias_level level) |
433 | { | 433 | { |
434 | u16 reg = snd_soc_read(codec, SSM2602_PWR) & 0xff7f; | 434 | u16 reg = snd_soc_read(codec, SSM2602_PWR); |
435 | reg &= ~(PWR_POWER_OFF | PWR_OSC_PDN); | ||
435 | 436 | ||
436 | switch (level) { | 437 | switch (level) { |
437 | case SND_SOC_BIAS_ON: | 438 | case SND_SOC_BIAS_ON: |
diff --git a/sound/soc/codecs/wm8753.c b/sound/soc/codecs/wm8753.c index ffa2ffe5ec1..aa091a0d818 100644 --- a/sound/soc/codecs/wm8753.c +++ b/sound/soc/codecs/wm8753.c | |||
@@ -1454,8 +1454,8 @@ static int wm8753_probe(struct snd_soc_codec *codec) | |||
1454 | /* set the update bits */ | 1454 | /* set the update bits */ |
1455 | snd_soc_update_bits(codec, WM8753_LDAC, 0x0100, 0x0100); | 1455 | snd_soc_update_bits(codec, WM8753_LDAC, 0x0100, 0x0100); |
1456 | snd_soc_update_bits(codec, WM8753_RDAC, 0x0100, 0x0100); | 1456 | snd_soc_update_bits(codec, WM8753_RDAC, 0x0100, 0x0100); |
1457 | snd_soc_update_bits(codec, WM8753_LDAC, 0x0100, 0x0100); | 1457 | snd_soc_update_bits(codec, WM8753_LADC, 0x0100, 0x0100); |
1458 | snd_soc_update_bits(codec, WM8753_RDAC, 0x0100, 0x0100); | 1458 | snd_soc_update_bits(codec, WM8753_RADC, 0x0100, 0x0100); |
1459 | snd_soc_update_bits(codec, WM8753_LOUT1V, 0x0100, 0x0100); | 1459 | snd_soc_update_bits(codec, WM8753_LOUT1V, 0x0100, 0x0100); |
1460 | snd_soc_update_bits(codec, WM8753_ROUT1V, 0x0100, 0x0100); | 1460 | snd_soc_update_bits(codec, WM8753_ROUT1V, 0x0100, 0x0100); |
1461 | snd_soc_update_bits(codec, WM8753_LOUT2V, 0x0100, 0x0100); | 1461 | snd_soc_update_bits(codec, WM8753_LOUT2V, 0x0100, 0x0100); |
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c index 1725550c293..d2c315fa1b9 100644 --- a/sound/soc/codecs/wm8962.c +++ b/sound/soc/codecs/wm8962.c | |||
@@ -3479,31 +3479,6 @@ int wm8962_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack) | |||
3479 | } | 3479 | } |
3480 | EXPORT_SYMBOL_GPL(wm8962_mic_detect); | 3480 | EXPORT_SYMBOL_GPL(wm8962_mic_detect); |
3481 | 3481 | ||
3482 | #ifdef CONFIG_PM | ||
3483 | static int wm8962_resume(struct snd_soc_codec *codec) | ||
3484 | { | ||
3485 | u16 *reg_cache = codec->reg_cache; | ||
3486 | int i; | ||
3487 | |||
3488 | /* Restore the registers */ | ||
3489 | for (i = 1; i < codec->driver->reg_cache_size; i++) { | ||
3490 | switch (i) { | ||
3491 | case WM8962_SOFTWARE_RESET: | ||
3492 | continue; | ||
3493 | default: | ||
3494 | break; | ||
3495 | } | ||
3496 | |||
3497 | if (reg_cache[i] != wm8962_reg[i]) | ||
3498 | snd_soc_write(codec, i, reg_cache[i]); | ||
3499 | } | ||
3500 | |||
3501 | return 0; | ||
3502 | } | ||
3503 | #else | ||
3504 | #define wm8962_resume NULL | ||
3505 | #endif | ||
3506 | |||
3507 | #if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE) | 3482 | #if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE) |
3508 | static int beep_rates[] = { | 3483 | static int beep_rates[] = { |
3509 | 500, 1000, 2000, 4000, | 3484 | 500, 1000, 2000, 4000, |
@@ -4015,7 +3990,6 @@ static int wm8962_remove(struct snd_soc_codec *codec) | |||
4015 | static struct snd_soc_codec_driver soc_codec_dev_wm8962 = { | 3990 | static struct snd_soc_codec_driver soc_codec_dev_wm8962 = { |
4016 | .probe = wm8962_probe, | 3991 | .probe = wm8962_probe, |
4017 | .remove = wm8962_remove, | 3992 | .remove = wm8962_remove, |
4018 | .resume = wm8962_resume, | ||
4019 | .set_bias_level = wm8962_set_bias_level, | 3993 | .set_bias_level = wm8962_set_bias_level, |
4020 | .reg_cache_size = WM8962_MAX_REGISTER + 1, | 3994 | .reg_cache_size = WM8962_MAX_REGISTER + 1, |
4021 | .reg_word_size = sizeof(u16), | 3995 | .reg_word_size = sizeof(u16), |
diff --git a/sound/soc/omap/mcpdm.c b/sound/soc/omap/mcpdm.c index 928f0370745..50e59194ad8 100644 --- a/sound/soc/omap/mcpdm.c +++ b/sound/soc/omap/mcpdm.c | |||
@@ -449,7 +449,7 @@ exit: | |||
449 | return ret; | 449 | return ret; |
450 | } | 450 | } |
451 | 451 | ||
452 | int __devexit omap_mcpdm_remove(struct platform_device *pdev) | 452 | int omap_mcpdm_remove(struct platform_device *pdev) |
453 | { | 453 | { |
454 | struct omap_mcpdm *mcpdm_ptr = platform_get_drvdata(pdev); | 454 | struct omap_mcpdm *mcpdm_ptr = platform_get_drvdata(pdev); |
455 | 455 | ||
diff --git a/sound/soc/omap/mcpdm.h b/sound/soc/omap/mcpdm.h index df3e16fb51f..20c20a8649f 100644 --- a/sound/soc/omap/mcpdm.h +++ b/sound/soc/omap/mcpdm.h | |||
@@ -150,4 +150,4 @@ extern int omap_mcpdm_request(void); | |||
150 | extern void omap_mcpdm_free(void); | 150 | extern void omap_mcpdm_free(void); |
151 | extern int omap_mcpdm_set_offset(int offset1, int offset2); | 151 | extern int omap_mcpdm_set_offset(int offset1, int offset2); |
152 | int __devinit omap_mcpdm_probe(struct platform_device *pdev); | 152 | int __devinit omap_mcpdm_probe(struct platform_device *pdev); |
153 | int __devexit omap_mcpdm_remove(struct platform_device *pdev); | 153 | int omap_mcpdm_remove(struct platform_device *pdev); |
diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c index ebcc2d4d2b1..478d6077845 100644 --- a/sound/soc/omap/omap-mcbsp.c +++ b/sound/soc/omap/omap-mcbsp.c | |||
@@ -516,6 +516,12 @@ static int omap_mcbsp_dai_set_dai_sysclk(struct snd_soc_dai *cpu_dai, | |||
516 | struct omap_mcbsp_reg_cfg *regs = &mcbsp_data->regs; | 516 | struct omap_mcbsp_reg_cfg *regs = &mcbsp_data->regs; |
517 | int err = 0; | 517 | int err = 0; |
518 | 518 | ||
519 | if (mcbsp_data->active) | ||
520 | if (freq == mcbsp_data->in_freq) | ||
521 | return 0; | ||
522 | else | ||
523 | return -EBUSY; | ||
524 | |||
519 | /* The McBSP signal muxing functions are only available on McBSP1 */ | 525 | /* The McBSP signal muxing functions are only available on McBSP1 */ |
520 | if (clk_id == OMAP_MCBSP_CLKR_SRC_CLKR || | 526 | if (clk_id == OMAP_MCBSP_CLKR_SRC_CLKR || |
521 | clk_id == OMAP_MCBSP_CLKR_SRC_CLKX || | 527 | clk_id == OMAP_MCBSP_CLKR_SRC_CLKX || |
diff --git a/sound/soc/pxa/zylonite.c b/sound/soc/pxa/zylonite.c index b6445757fc5..2b8350b5223 100644 --- a/sound/soc/pxa/zylonite.c +++ b/sound/soc/pxa/zylonite.c | |||
@@ -196,20 +196,20 @@ static int zylonite_probe(struct snd_soc_card *card) | |||
196 | if (clk_pout) { | 196 | if (clk_pout) { |
197 | pout = clk_get(NULL, "CLK_POUT"); | 197 | pout = clk_get(NULL, "CLK_POUT"); |
198 | if (IS_ERR(pout)) { | 198 | if (IS_ERR(pout)) { |
199 | dev_err(&pdev->dev, "Unable to obtain CLK_POUT: %ld\n", | 199 | dev_err(card->dev, "Unable to obtain CLK_POUT: %ld\n", |
200 | PTR_ERR(pout)); | 200 | PTR_ERR(pout)); |
201 | return PTR_ERR(pout); | 201 | return PTR_ERR(pout); |
202 | } | 202 | } |
203 | 203 | ||
204 | ret = clk_enable(pout); | 204 | ret = clk_enable(pout); |
205 | if (ret != 0) { | 205 | if (ret != 0) { |
206 | dev_err(&pdev->dev, "Unable to enable CLK_POUT: %d\n", | 206 | dev_err(card->dev, "Unable to enable CLK_POUT: %d\n", |
207 | ret); | 207 | ret); |
208 | clk_put(pout); | 208 | clk_put(pout); |
209 | return ret; | 209 | return ret; |
210 | } | 210 | } |
211 | 211 | ||
212 | dev_dbg(&pdev->dev, "MCLK enabled at %luHz\n", | 212 | dev_dbg(card->dev, "MCLK enabled at %luHz\n", |
213 | clk_get_rate(pout)); | 213 | clk_get_rate(pout)); |
214 | } | 214 | } |
215 | 215 | ||
@@ -241,7 +241,7 @@ static int zylonite_resume_pre(struct snd_soc_card *card) | |||
241 | if (clk_pout) { | 241 | if (clk_pout) { |
242 | ret = clk_enable(pout); | 242 | ret = clk_enable(pout); |
243 | if (ret != 0) | 243 | if (ret != 0) |
244 | dev_err(&pdev->dev, "Unable to enable CLK_POUT: %d\n", | 244 | dev_err(card->dev, "Unable to enable CLK_POUT: %d\n", |
245 | ret); | 245 | ret); |
246 | } | 246 | } |
247 | 247 | ||
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index d2ef014af21..ef69f5a0270 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/bitops.h> | 30 | #include <linux/bitops.h> |
31 | #include <linux/debugfs.h> | 31 | #include <linux/debugfs.h> |
32 | #include <linux/platform_device.h> | 32 | #include <linux/platform_device.h> |
33 | #include <linux/ctype.h> | ||
33 | #include <linux/slab.h> | 34 | #include <linux/slab.h> |
34 | #include <sound/ac97_codec.h> | 35 | #include <sound/ac97_codec.h> |
35 | #include <sound/core.h> | 36 | #include <sound/core.h> |
@@ -1434,9 +1435,20 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card) | |||
1434 | "%s", card->name); | 1435 | "%s", card->name); |
1435 | snprintf(card->snd_card->longname, sizeof(card->snd_card->longname), | 1436 | snprintf(card->snd_card->longname, sizeof(card->snd_card->longname), |
1436 | "%s", card->long_name ? card->long_name : card->name); | 1437 | "%s", card->long_name ? card->long_name : card->name); |
1437 | if (card->driver_name) | 1438 | snprintf(card->snd_card->driver, sizeof(card->snd_card->driver), |
1438 | strlcpy(card->snd_card->driver, card->driver_name, | 1439 | "%s", card->driver_name ? card->driver_name : card->name); |
1439 | sizeof(card->snd_card->driver)); | 1440 | for (i = 0; i < ARRAY_SIZE(card->snd_card->driver); i++) { |
1441 | switch (card->snd_card->driver[i]) { | ||
1442 | case '_': | ||
1443 | case '-': | ||
1444 | case '\0': | ||
1445 | break; | ||
1446 | default: | ||
1447 | if (!isalnum(card->snd_card->driver[i])) | ||
1448 | card->snd_card->driver[i] = '_'; | ||
1449 | break; | ||
1450 | } | ||
1451 | } | ||
1440 | 1452 | ||
1441 | if (card->late_probe) { | 1453 | if (card->late_probe) { |
1442 | ret = card->late_probe(card); | 1454 | ret = card->late_probe(card); |
diff --git a/sound/usb/card.c b/sound/usb/card.c index 781d9e61adf..d8f2bf40145 100644 --- a/sound/usb/card.c +++ b/sound/usb/card.c | |||
@@ -530,8 +530,11 @@ snd_usb_audio_probe(struct usb_device *dev, | |||
530 | return chip; | 530 | return chip; |
531 | 531 | ||
532 | __error: | 532 | __error: |
533 | if (chip && !chip->num_interfaces) | 533 | if (chip) { |
534 | snd_card_free(chip->card); | 534 | if (!chip->num_interfaces) |
535 | snd_card_free(chip->card); | ||
536 | chip->probing = 0; | ||
537 | } | ||
535 | mutex_unlock(®ister_mutex); | 538 | mutex_unlock(®ister_mutex); |
536 | __err_val: | 539 | __err_val: |
537 | return NULL; | 540 | return NULL; |