Skip to contentSkip to conversation

ARM: DaVinci: ASoc: Minor fixes to probe function

PATCH Applied [email protected] 2 participants 2 messages Jun 8, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: DaVinci: ASoc: Minor fixes to probe function

From: Chaithrika U S <[email protected]>

Assign proper errors when platform resource claims fail.

---
Applies to branch 'davinci' of:

	git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6.git
 sound/soc/davinci/davinci-i2s.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
sound/soc/davinci/davinci-i2s.c +3 -1
index 500d2f5..2f11970 100644
@@ -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;
Signature · 1 line
1.5.6