Commit 673bca1906334972c2b54e7c7c002941329039cd
Exists in
master
and in
4 other branches
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
sound/soc/codecs/ad1938.c
sound/soc/codecs/wm8974.c
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) |