Skip to content

Commit

Permalink
ASoC: Minor fixes to DaVinci I2S probe function
Browse files Browse the repository at this point in the history
Assign proper errors when platform resource claims fail.

Signed-off-by: Chaithrika U S <chaithrika@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Chaithrika U S authored and Mark Brown committed Jun 8, 2009
1 parent 04f80f5 commit efd13be
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sound/soc/davinci/davinci-i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ static int davinci_i2s_probe(struct platform_device *pdev)
struct snd_platform_data *pdata = pdev->dev.platform_data;
struct davinci_mcbsp_dev *dev;
struct resource *mem, *ioarea, *res;
int ret = 0;
int ret;

mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!mem) {
Expand Down Expand Up @@ -511,13 +511,15 @@ static int davinci_i2s_probe(struct platform_device *pdev)
res = platform_get_resource(pdev, IORESOURCE_DMA, 0);
if (!res) {
dev_err(&pdev->dev, "no DMA resource\n");
ret = -ENXIO;
goto err_free_mem;
}
dev->dma_params[SNDRV_PCM_STREAM_PLAYBACK]->channel = res->start;

res = platform_get_resource(pdev, IORESOURCE_DMA, 1);
if (!res) {
dev_err(&pdev->dev, "no DMA resource\n");
ret = -ENXIO;
goto err_free_mem;
}
dev->dma_params[SNDRV_PCM_STREAM_CAPTURE]->channel = res->start;
Expand Down

0 comments on commit efd13be

Please sign in to comment.