Skip to contentSkip to conversation

ASoC: tas2552: Propagate the error code in suspend/resume

PATCH In review Fabio Estevam 2 participants 2 messages Apr 25, 2017

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

PATCH 1/1 ASoC: tas2552: Propagate the error code in suspend/resume

From: Fabio Estevam <[email protected]>

tas2552_suspend() and tas2552_resume() currently always return success, even though they may fail.

Fix this behaviour by always propagating the error code.

---
 sound/soc/codecs/tas2552.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/tas2552.c +2 -2
index fd5251e..8840f72 100644
@@ -637,7 +637,7 @@ static int tas2552_suspend(struct snd_soc_codec *codec)
 	if (ret != 0)
 		dev_err(codec->dev, "Failed to disable supplies: %d\n",
 			ret);
-	return 0;
+	return ret;
 }
 
 static int tas2552_resume(struct snd_soc_codec *codec)
@@ -653,7 +653,7 @@ static int tas2552_resume(struct snd_soc_codec *codec)
 			ret);
 	}
 
-	return 0;
+	return ret;
 }
 #else
 #define tas2552_suspend NULL
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

tas2552_suspend() and tas2552_resume() currently always return success, even though they may fail.

Fix this behaviour by always propagating the error code.

Quoted 27 lines
---
 sound/soc/codecs/tas2552.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/tas2552.c +2 -2
index fd5251e..8840f72 100644
@@ -637,7 +637,7 @@ static int tas2552_suspend(struct snd_soc_codec *codec)
 	if (ret != 0)
 		dev_err(codec->dev, "Failed to disable supplies: %d\n",
 			ret);
-	return 0;
+	return ret;
 }
 
 static int tas2552_resume(struct snd_soc_codec *codec)
@@ -653,7 +653,7 @@ static int tas2552_resume(struct snd_soc_codec *codec)
 			ret);
 	}
 
-	return 0;
+	return ret;
 }
 #else
 #define tas2552_suspend NULL
Signature · 2 lines
------------------
Dan Murphy