Commit 673bca1906334972c2b54e7c7c002941329039cd

Authored by Takashi Iwai

Merge branch 'fix/asoc' into for-linus

* fix/asoc:
  ASoC: remove unused #include <linux/version.h>
  ASoC: S3C lrsync function made to work with IRQs disabled.
  ASoC: Fix display of stream name in DAPM debugfs
  ASoC: Clean up error handling in MPC5200 DMA setup

Showing 6 changed files Side-by-side Diff

sound/soc/codecs/ad1836.c
... ... @@ -18,7 +18,6 @@
18 18  
19 19 #include <linux/init.h>
20 20 #include <linux/module.h>
21   -#include <linux/version.h>
22 21 #include <linux/kernel.h>
23 22 #include <linux/device.h>
24 23 #include <sound/core.h>
sound/soc/codecs/ad1938.c
... ... @@ -28,7 +28,6 @@
28 28  
29 29 #include <linux/init.h>
30 30 #include <linux/module.h>
31   -#include <linux/version.h>
32 31 #include <linux/kernel.h>
33 32 #include <linux/device.h>
34 33 #include <sound/core.h>
sound/soc/codecs/wm8974.c
... ... @@ -12,7 +12,6 @@
12 12  
13 13 #include <linux/module.h>
14 14 #include <linux/moduleparam.h>
15   -#include <linux/version.h>
16 15 #include <linux/kernel.h>
17 16 #include <linux/init.h>
18 17 #include <linux/delay.h>
sound/soc/fsl/mpc5200_dma.c
... ... @@ -447,6 +447,7 @@
447 447 int size, irq, rc;
448 448 const __be32 *prop;
449 449 void __iomem *regs;
  450 + int ret;
450 451  
451 452 /* Fetch the registers and IRQ of the PSC */
452 453 irq = irq_of_parse_and_map(op->node, 0);
453 454  
... ... @@ -463,14 +464,16 @@
463 464 /* Allocate and initialize the driver private data */
464 465 psc_dma = kzalloc(sizeof *psc_dma, GFP_KERNEL);
465 466 if (!psc_dma) {
466   - iounmap(regs);
467   - return -ENOMEM;
  467 + ret = -ENOMEM;
  468 + goto out_unmap;
468 469 }
469 470  
470 471 /* Get the PSC ID */
471 472 prop = of_get_property(op->node, "cell-index", &size);
472   - if (!prop || size < sizeof *prop)
473   - return -ENODEV;
  473 + if (!prop || size < sizeof *prop) {
  474 + ret = -ENODEV;
  475 + goto out_free;
  476 + }
474 477  
475 478 spin_lock_init(&psc_dma->lock);
476 479 mutex_init(&psc_dma->mutex);
... ... @@ -493,9 +496,8 @@
493 496 if (!psc_dma->capture.bcom_task ||
494 497 !psc_dma->playback.bcom_task) {
495 498 dev_err(&op->dev, "Could not allocate bestcomm tasks\n");
496   - iounmap(regs);
497   - kfree(psc_dma);
498   - return -ENODEV;
  499 + ret = -ENODEV;
  500 + goto out_free;
499 501 }
500 502  
501 503 /* Disable all interrupts and reset the PSC */
... ... @@ -537,12 +539,8 @@
537 539 &psc_dma_bcom_irq_tx, IRQF_SHARED,
538 540 "psc-dma-playback", &psc_dma->playback);
539 541 if (rc) {
540   - free_irq(psc_dma->irq, psc_dma);
541   - free_irq(psc_dma->capture.irq,
542   - &psc_dma->capture);
543   - free_irq(psc_dma->playback.irq,
544   - &psc_dma->playback);
545   - return -ENODEV;
  542 + ret = -ENODEV;
  543 + goto out_irq;
546 544 }
547 545  
548 546 /* Save what we've done so it can be found again later */
... ... @@ -550,6 +548,15 @@
550 548  
551 549 /* Tell the ASoC OF helpers about it */
552 550 return snd_soc_register_platform(&mpc5200_audio_dma_platform);
  551 +out_irq:
  552 + free_irq(psc_dma->irq, psc_dma);
  553 + free_irq(psc_dma->capture.irq, &psc_dma->capture);
  554 + free_irq(psc_dma->playback.irq, &psc_dma->playback);
  555 +out_free:
  556 + kfree(psc_dma);
  557 +out_unmap:
  558 + iounmap(regs);
  559 + return ret;
553 560 }
554 561 EXPORT_SYMBOL_GPL(mpc5200_audio_dma_create);
555 562  
sound/soc/s3c24xx/s3c-i2s-v2.c
... ... @@ -230,6 +230,8 @@
230 230 pr_debug("%s: IIS: CON=%x MOD=%x FIC=%x\n", __func__, con, mod, fic);
231 231 }
232 232  
  233 +#define msecs_to_loops(t) (loops_per_jiffy / 1000 * HZ * t)
  234 +
233 235 /*
234 236 * Wait for the LR signal to allow synchronisation to the L/R clock
235 237 * from the codec. May only be needed for slave mode.
236 238  
237 239  
... ... @@ -237,19 +239,21 @@
237 239 static int s3c2412_snd_lrsync(struct s3c_i2sv2_info *i2s)
238 240 {
239 241 u32 iiscon;
240   - unsigned long timeout = jiffies + msecs_to_jiffies(5);
  242 + unsigned long loops = msecs_to_loops(5);
241 243  
242 244 pr_debug("Entered %s\n", __func__);
243 245  
244   - while (1) {
  246 + while (--loops) {
245 247 iiscon = readl(i2s->regs + S3C2412_IISCON);
246 248 if (iiscon & S3C2412_IISCON_LRINDEX)
247 249 break;
248 250  
249   - if (timeout < jiffies) {
250   - printk(KERN_ERR "%s: timeout\n", __func__);
251   - return -ETIMEDOUT;
252   - }
  251 + cpu_relax();
  252 + }
  253 +
  254 + if (!loops) {
  255 + printk(KERN_ERR "%s: timeout\n", __func__);
  256 + return -ETIMEDOUT;
253 257 }
254 258  
255 259 return 0;
sound/soc/soc-dapm.c
... ... @@ -1131,9 +1131,10 @@
1131 1131 ret = snprintf(buf, PAGE_SIZE, "%s: %s in %d out %d\n",
1132 1132 w->name, w->power ? "On" : "Off", in, out);
1133 1133  
1134   - if (w->active && w->sname)
1135   - ret += snprintf(buf, PAGE_SIZE - ret, " stream %s active\n",
1136   - w->sname);
  1134 + if (w->sname)
  1135 + ret += snprintf(buf + ret, PAGE_SIZE - ret, " stream %s %s\n",
  1136 + w->sname,
  1137 + w->active ? "active" : "inactive");
1137 1138  
1138 1139 list_for_each_entry(p, &w->sources, list_sink) {
1139 1140 if (p->connect)