summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorBhalchandra Gajare <gajare@codeaurora.org>2016-10-12 15:37:52 -0700
committerBhalchandra Gajare <gajare@codeaurora.org>2016-10-12 15:41:29 -0700
commite92ad0d204333c5b5dceb9d1573a71a49a713db6 (patch)
treeb470de28ded5f721e6758ef32db76e9649b4c7e6 /sound
parent67598d84280a9a9f3d2770379627fec1f1762297 (diff)
ASoC: wcd-spi: Initialize local variables before usage
Initliaze the local variables that are used in functions to return success or error codes. This fixes possible cases where undefined error codes are returned. CRs-Fixed: 1070186 Change-Id: I74bed6cfd9753765b15d17d69ba30f61875e87c8 Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/wcd-spi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/codecs/wcd-spi.c b/sound/soc/codecs/wcd-spi.c
index 60efcb174740..2af7dd851f53 100644
--- a/sound/soc/codecs/wcd-spi.c
+++ b/sound/soc/codecs/wcd-spi.c
@@ -319,7 +319,7 @@ static int wcd_spi_transfer_split(struct spi_device *spi,
u32 addr = data_msg->remote_addr;
u8 *data = data_msg->data;
int remain_size = data_msg->len;
- int to_xfer, loop_cnt, ret;
+ int to_xfer, loop_cnt, ret = 0;
/* Perform single writes until multi word alignment is met */
loop_cnt = 1;
@@ -837,7 +837,7 @@ static int wdsp_spi_event_handler(struct device *dev, void *priv_data,
void *data)
{
struct spi_device *spi = to_spi_device(dev);
- int ret;
+ int ret = 0;
dev_dbg(&spi->dev, "%s: event type %d\n",
__func__, event);