Skip to content

Commit 8267ebc

Browse files
charleskeepaxchanwoochoi
authored andcommitted
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 <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
1 parent f4ba6c0 commit 8267ebc

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/extcon/extcon-arizona.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -960,14 +960,13 @@ static void arizona_micd_detect(struct work_struct *work)
960960
input_report_key(info->input,
961961
info->micd_ranges[i].key, 0);
962962

963-
WARN_ON(!lvl);
964-
WARN_ON(ffs(lvl) - 1 >= info->num_micd_ranges);
965963
if (lvl && ffs(lvl) - 1 < info->num_micd_ranges) {
966964
key = info->micd_ranges[ffs(lvl) - 1].key;
967965
input_report_key(info->input, key, 1);
968966
input_sync(info->input);
967+
} else {
968+
dev_err(arizona->dev, "Button out of range\n");
969969
}
970-
971970
} else if (info->detecting) {
972971
dev_dbg(arizona->dev, "Headphone detected\n");
973972
info->detecting = false;

0 commit comments

Comments
 (0)