summaryrefslogtreecommitdiffstats
path: root/sound/pci/hda
diff options
context:
space:
mode:
authorMohan Kumar <mkumard@nvidia.com>2017-01-09 02:55:51 -0500
committerSameer Pujar <spujar@nvidia.com>2017-08-07 05:31:00 -0400
commit7e7a074a10e960bae74eb37d990f18ac8dbaf132 (patch)
treed3f71b0c41d72da1b294bea7d7a35a5704766e1a /sound/pci/hda
parentb2032b4dc7339d5ee57fb7730ef159167c4e69fe (diff)
ALSA: hda: fix coverity issue 1705804
Handle return values from functions properly to avoid coverity defects. Coverity ID: 1705804 Bug 200192147 Change-Id: I5cba9dfababcd4764097c22ba9381407cc1f4a7d Signed-off-by: Mohan Kumar <mkumard@nvidia.com> Reviewed-on: http://git-master/r/1282007 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Asha Talambedu <atalambedu@nvidia.com> Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Diffstat (limited to 'sound/pci/hda')
-rw-r--r--sound/pci/hda/hda_tegra.c28
1 files changed, 23 insertions, 5 deletions
diff --git a/sound/pci/hda/hda_tegra.c b/sound/pci/hda/hda_tegra.c
index de11691c1..1c1402491 100644
--- a/sound/pci/hda/hda_tegra.c
+++ b/sound/pci/hda/hda_tegra.c
@@ -229,10 +229,15 @@ static void hda_tegra_init(struct hda_tegra *hda)
229 229
230static int hda_tegra_enable_clocks(struct hda_tegra *hda) 230static int hda_tegra_enable_clocks(struct hda_tegra *hda)
231{ 231{
232 struct device *dev = hda->dev;
232 int rc; 233 int rc;
233 234
234 if (hda->is_power_on == false) { 235 if (hda->is_power_on == false) {
235 tegra_unpowergate_partition(hda->partition_id); 236 rc = tegra_unpowergate_partition(hda->partition_id);
237 if (rc < 0) {
238 dev_err(dev, "Unpower gating HDA partition Failed\n");
239 return rc;
240 }
236 hda->is_power_on = true; 241 hda->is_power_on = true;
237 } 242 }
238 243
@@ -252,22 +257,35 @@ disable_codec_2x:
252 clk_disable_unprepare(hda->hda2codec_2x_clk); 257 clk_disable_unprepare(hda->hda2codec_2x_clk);
253disable_hda: 258disable_hda:
254 clk_disable_unprepare(hda->hda_clk); 259 clk_disable_unprepare(hda->hda_clk);
255 if (hda->is_power_on) 260 if (hda->is_power_on) {
256 tegra_powergate_partition(hda->partition_id); 261 rc = tegra_powergate_partition(hda->partition_id);
262 if (rc < 0) {
263 dev_err(dev, "Power gating HDA partition Failed\n");
264 return rc;
265 }
266 }
257 hda->is_power_on = false; 267 hda->is_power_on = false;
258 return rc; 268 return rc;
259} 269}
260 270
261static void hda_tegra_disable_clocks(struct hda_tegra *hda) 271static int hda_tegra_disable_clocks(struct hda_tegra *hda)
262{ 272{
273 struct device *dev = hda->dev;
274 int rc = 0;
275
263 clk_disable_unprepare(hda->hda2hdmi_clk); 276 clk_disable_unprepare(hda->hda2hdmi_clk);
264 clk_disable_unprepare(hda->hda2codec_2x_clk); 277 clk_disable_unprepare(hda->hda2codec_2x_clk);
265 clk_disable_unprepare(hda->hda_clk); 278 clk_disable_unprepare(hda->hda_clk);
266 279
267 if (hda->is_power_on) { 280 if (hda->is_power_on) {
268 tegra_powergate_partition(hda->partition_id); 281 rc = tegra_powergate_partition(hda->partition_id);
282 if (rc < 0) {
283 dev_err(dev, "Power gating HDA partition Failed\n");
284 return rc;
285 }
269 hda->is_power_on = false; 286 hda->is_power_on = false;
270 } 287 }
288 return 0;
271} 289}
272 290
273/* 291/*