Skip to contentSkip to conversation

ASoC: Fix hx4700 error handling to free gpios if snd_soc_register_card fails

PATCH Applied Axel Lin 2 participants 2 messages Dec 12, 2011

Subsystems (3)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 ASoC: Fix hx4700 error handling to free gpios if snd_soc_register_card fails

---
 sound/soc/pxa/hx4700.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
sound/soc/pxa/hx4700.c +3 -2
index e32afaf..03ef9f3 100644
@@ -209,9 +209,10 @@ static int __devinit hx4700_audio_probe(struct platform_device *pdev)
 	snd_soc_card_hx4700.dev = &pdev->dev;
 	ret = snd_soc_register_card(&snd_soc_card_hx4700);
 	if (ret)
-		return ret;
+		gpio_free_array(hx4700_audio_gpios,
+				ARRAY_SIZE(hx4700_audio_gpios));
 
-	return 0;
+	return ret;
 }
 
 static int __devexit hx4700_audio_remove(struct platform_device *pdev)
Signature · 1 line
1.7.5.4