From 6dc194feac8557ea1f799a9f7e43362dbae43985 Mon Sep 17 00:00:00 2001 From: Manikantan R Date: Tue, 28 Mar 2023 10:49:42 +0530 Subject: asoc: wcd9xxx : wcd934x: err handling & pointer invalidation Fix error handling and pointer invalidation Signed-off-by:Manikantan R Change-Id: I528030f11ca60faeb627ff323d288d42e1b7ed8e --- asoc/codecs/wcd9xxx-core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'asoc/codecs/wcd9xxx-core.c') 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); -- cgit v1.2.3