]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ASoC: samsung: spdif: Fix DMA filter initialization
authorSylwester Nawrocki <s.nawrocki@samsung.com>
Wed, 2 Nov 2016 11:03:03 +0000 (12:03 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 2 Nov 2016 15:15:27 +0000 (09:15 -0600)
This patch fixes issues introduced in commit 6956384c1790f250ede47c08
"ASoC: samsung: get access to DMA engine early to defer probe properly"
and indicated by a following compilation warning:

  CC [M]  sound/soc/samsung/spdif.o
sound/soc/samsung/spdif.c: In function ‘spdif_probe’:
sound/soc/samsung/spdif.c:419:6: warning: ‘filter’ may be used uninitialized
in this function [-Wuninitialized]

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/samsung/spdif.c

index 704b7b12bf8b90b979074ed9ef7f1540452b8b22..779504f54bc074fcaec0ce179483b3a4a1bc17ee 100644 (file)
@@ -416,6 +416,15 @@ static int spdif_probe(struct platform_device *pdev)
                goto err3;
        }
 
+       spdif_stereo_out.addr_width = 2;
+       spdif_stereo_out.addr = mem_res->start + DATA_OUTBUF;
+       filter = NULL;
+       if (spdif_pdata) {
+               spdif_stereo_out.filter_data = spdif_pdata->dma_playback;
+               filter = spdif_pdata->dma_filter;
+       }
+       spdif->dma_playback = &spdif_stereo_out;
+
        ret = samsung_asoc_dma_platform_register(&pdev->dev, filter,
                                                 NULL, NULL);
        if (ret) {
@@ -432,16 +441,6 @@ static int spdif_probe(struct platform_device *pdev)
                goto err4;
        }
 
-       spdif_stereo_out.addr_width = 2;
-       spdif_stereo_out.addr = mem_res->start + DATA_OUTBUF;
-       filter = NULL;
-       if (spdif_pdata) {
-               spdif_stereo_out.filter_data = spdif_pdata->dma_playback;
-               filter = spdif_pdata->dma_filter;
-       }
-
-       spdif->dma_playback = &spdif_stereo_out;
-
        return 0;
 err4:
        iounmap(spdif->regs);