From 83ef26ac1326fdd2fc8d160967cdca2e8b46ccd4 Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Mon, 4 Sep 2017 11:12:32 +0100 Subject: ASoC: cs43130: fix spelling mistake: "irq_occurrance" -> "irq_occurrence" Trivial fix to spelling mistake in variable name Signed-off-by: Colin Ian King Signed-off-by: Mark Brown --- sound/soc/codecs/cs43130.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sound/soc') diff --git a/sound/soc/codecs/cs43130.c b/sound/soc/codecs/cs43130.c index 220e30199c5b..9f1aa0516fd0 100644 --- a/sound/soc/codecs/cs43130.c +++ b/sound/soc/codecs/cs43130.c @@ -2147,7 +2147,7 @@ static irqreturn_t cs43130_irq_thread(int irq, void *data) struct cs43130_private *cs43130 = (struct cs43130_private *)data; struct snd_soc_codec *codec = cs43130->codec; unsigned int stickies[CS43130_NUM_INT]; - unsigned int irq_occurrance = 0; + unsigned int irq_occurrence = 0; unsigned int masks[CS43130_NUM_INT]; int i, j; @@ -2161,12 +2161,12 @@ static irqreturn_t cs43130_irq_thread(int irq, void *data) for (i = 0; i < ARRAY_SIZE(stickies); i++) { stickies[i] = stickies[i] & (~masks[i]); for (j = 0; j < 8; j++) - irq_occurrance += (stickies[i] >> j) & 1; + irq_occurrence += (stickies[i] >> j) & 1; } dev_dbg(codec->dev, "number of interrupts occurred (%u)\n", - irq_occurrance); + irq_occurrence); - if (!irq_occurrance) + if (!irq_occurrence) return IRQ_NONE; if (stickies[0] & CS43130_XTAL_RDY_INT) { -- cgit v1.2.3-59-g8ed1b From f31877a16b0926dea4d1d9b72917a3eca9be19b6 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 4 Sep 2017 15:54:47 +0200 Subject: ASoC: cs43130: Fix possible Oops with invalid dev_id MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As compiler spotted out, there is the potential NULL-dereference in the code when dc-measure OF is given for other than 43130/43131: sound/soc/codecs/cs43130.c:2089:18: warning: ‘hpload_seq’ may be used uninitialized in this function [-Wmaybe-uninitialized] Warn it and return before triggering Oops. Fixes: 8f1e5bf9b440 ("ASoC: cs43130: Add support for CS43130 codec") Signed-off-by: Takashi Iwai Signed-off-by: Mark Brown --- sound/soc/codecs/cs43130.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sound/soc') diff --git a/sound/soc/codecs/cs43130.c b/sound/soc/codecs/cs43130.c index 9f1aa0516fd0..4229a95e2859 100644 --- a/sound/soc/codecs/cs43130.c +++ b/sound/soc/codecs/cs43130.c @@ -2079,6 +2079,10 @@ static void cs43130_imp_meas(struct work_struct *wk) case CS43131_CHIP_ID: hpload_seq = hpload_seq2; seq_size = ARRAY_SIZE(hpload_seq2); + break; + default: + WARN(1, "Invalid dev_id for meas: %d", cs43130->dev_id); + return; } i = 0; -- cgit v1.2.3-59-g8ed1b From 7051334672e54fae67e02d5d3296fb62b3343be7 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 4 Sep 2017 15:54:48 +0200 Subject: ASoC: cs43130: Fix unused compiler warnings for PM runtime MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add __maybe_unused prefix for addressing the following warnings: sound/soc/codecs/cs43130.c:2615:12: warning: ‘cs43130_runtime_resume’ defined but not used [-Wunused-function] sound/soc/codecs/cs43130.c:2596:12: warning: ‘cs43130_runtime_suspend’ defined but not used [-Wunused-function] Fixes: 8f1e5bf9b440 ("ASoC: cs43130: Add support for CS43130 codec") Signed-off-by: Takashi Iwai Signed-off-by: Mark Brown --- sound/soc/codecs/cs43130.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sound/soc') diff --git a/sound/soc/codecs/cs43130.c b/sound/soc/codecs/cs43130.c index 4229a95e2859..643e37fc218e 100644 --- a/sound/soc/codecs/cs43130.c +++ b/sound/soc/codecs/cs43130.c @@ -2597,7 +2597,7 @@ static int cs43130_i2c_remove(struct i2c_client *client) return 0; } -static int cs43130_runtime_suspend(struct device *dev) +static int __maybe_unused cs43130_runtime_suspend(struct device *dev) { struct cs43130_private *cs43130 = dev_get_drvdata(dev); @@ -2616,7 +2616,7 @@ static int cs43130_runtime_suspend(struct device *dev) return 0; } -static int cs43130_runtime_resume(struct device *dev) +static int __maybe_unused cs43130_runtime_resume(struct device *dev) { struct cs43130_private *cs43130 = dev_get_drvdata(dev); int ret; -- cgit v1.2.3-59-g8ed1b