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>
This commit is contained in:
parent
f4ba6c0ba7
commit
8267ebcc46
@ -960,14 +960,13 @@ static void arizona_micd_detect(struct work_struct *work)
|
|||||||
input_report_key(info->input,
|
input_report_key(info->input,
|
||||||
info->micd_ranges[i].key, 0);
|
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) {
|
if (lvl && ffs(lvl) - 1 < info->num_micd_ranges) {
|
||||||
key = info->micd_ranges[ffs(lvl) - 1].key;
|
key = info->micd_ranges[ffs(lvl) - 1].key;
|
||||||
input_report_key(info->input, key, 1);
|
input_report_key(info->input, key, 1);
|
||||||
input_sync(info->input);
|
input_sync(info->input);
|
||||||
|
} else {
|
||||||
|
dev_err(arizona->dev, "Button out of range\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (info->detecting) {
|
} else if (info->detecting) {
|
||||||
dev_dbg(arizona->dev, "Headphone detected\n");
|
dev_dbg(arizona->dev, "Headphone detected\n");
|
||||||
info->detecting = false;
|
info->detecting = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user