summaryrefslogtreecommitdiff
path: root/asoc
diff options
context:
space:
mode:
authorManikantan R <quic_manrav@quicinc.com>2023-03-28 10:49:42 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2023-03-27 22:57:46 -0700
commit6dc194feac8557ea1f799a9f7e43362dbae43985 (patch)
tree0094f0851af02c4dc7f9e49353085d8b090b26f7 /asoc
parent3fd5861f0b238a1eec099fc7af48f16251f30846 (diff)
downloadmsm-extra-6dc194feac8557ea1f799a9f7e43362dbae43985.tar.gz
asoc: wcd9xxx : wcd934x: err handling & pointer invalidation
Fix error handling and pointer invalidation Signed-off-by:Manikantan R <quic_manrav@quicinc.com> Change-Id: I528030f11ca60faeb627ff323d288d42e1b7ed8e
Diffstat (limited to 'asoc')
-rw-r--r--asoc/codecs/wcd934x/wcd934x.c1
-rw-r--r--asoc/codecs/wcd9xxx-core.c5
2 files changed, 5 insertions, 1 deletions
diff --git a/asoc/codecs/wcd934x/wcd934x.c b/asoc/codecs/wcd934x/wcd934x.c
index 48dfc95e..b4f193ae 100644
--- a/asoc/codecs/wcd934x/wcd934x.c
+++ b/asoc/codecs/wcd934x/wcd934x.c
@@ -11462,6 +11462,7 @@ err_resmgr:
mutex_destroy(&tavil->swr.write_mutex);
mutex_destroy(&tavil->swr.clk_mutex);
devm_kfree(&pdev->dev, tavil);
+ platform_set_drvdata(pdev, NULL);
return ret;
}
diff --git a/asoc/codecs/wcd9xxx-core.c b/asoc/codecs/wcd9xxx-core.c
index e417d174..ec0acb90 100644
--- a/asoc/codecs/wcd9xxx-core.c
+++ b/asoc/codecs/wcd9xxx-core.c
@@ -1242,9 +1242,12 @@ static int wcd9xxx_i2c_probe(struct i2c_client *client,
ret = wcd9xxx_i2c_read(wcd9xxx, WCD9XXX_A_CHIP_STATUS, 1,
&val, 0);
- if (ret < 0)
+ if (ret < 0) {
pr_err("%s: failed to read the wcd9xxx status (%d)\n",
__func__, ret);
+ ret = 0;
+ }
+
if (val != wcd9xxx->codec_type->i2c_chip_status)
pr_err("%s: unknown chip status 0x%x\n", __func__, val);