ASoC: Minor fixes to DaVinci I2S probe function
authorChaithrika U S <chaithrika@ti.com>
Mon, 8 Jun 2009 10:49:41 +0000 (06:49 -0400)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 8 Jun 2009 13:55:12 +0000 (14:55 +0100)
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>
sound/soc/davinci/davinci-i2s.c

index 500d2f57418648c5199a22074f46606c45fff27e..2f11970e6406595af1b4f9de7b4857895f55e4ac 100644 (file)
@@ -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) {
@@ -511,6 +511,7 @@ 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;
@@ -518,6 +519,7 @@ static int davinci_i2s_probe(struct platform_device *pdev)
        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;