summaryrefslogtreecommitdiff
path: root/drivers/extcon
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.cirrus.com>2019-12-09 11:09:13 +0000
committerChanwoo Choi <cw00.choi@samsung.com>2019-12-09 20:18:14 +0900
commit8267ebcc46176d90b7b169440ebbc890e09a5010 (patch)
treeba12a5b4c747b6f8cab720fc886b5ec5830d9aa7 /drivers/extcon
parentf4ba6c0ba762e10b0bad42b5d28f7e2ab1fe5ff9 (diff)
downloadlwn-8267ebcc46176d90b7b169440ebbc890e09a5010.tar.gz
lwn-8267ebcc46176d90b7b169440ebbc890e09a5010.zip
extcon: arizona: Remove excessive WARN_ON
A WARN_ON is very strong for simply finding a button that is out of range, downgrade this to a simple error message in the log. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Diffstat (limited to 'drivers/extcon')
-rw-r--r--drivers/extcon/extcon-arizona.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c
index e7c198e798e2..3f7ced35e0b8 100644
--- a/drivers/extcon/extcon-arizona.c
+++ b/drivers/extcon/extcon-arizona.c
@@ -960,14 +960,13 @@ static void arizona_micd_detect(struct work_struct *work)
input_report_key(info->input,
info->micd_ranges[i].key, 0);
- WARN_ON(!lvl);
- WARN_ON(ffs(lvl) - 1 >= info->num_micd_ranges);
if (lvl && ffs(lvl) - 1 < info->num_micd_ranges) {
key = info->micd_ranges[ffs(lvl) - 1].key;
input_report_key(info->input, key, 1);
input_sync(info->input);
+ } else {
+ dev_err(arizona->dev, "Button out of range\n");
}
-
} else if (info->detecting) {
dev_dbg(arizona->dev, "Headphone detected\n");
info->detecting = false;