Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

extcon: max77693: fix handling return value of regmap_irq_get_virq

The function can return negative values, so its result should
be assigned to signed variable.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Suggested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>

authored by

Andrzej Hajda and committed by
Chanwoo Choi
cbc46603 c2957563

+2 -2
+2 -2
drivers/extcon/extcon-max77693.c
··· 1127 1127 /* Support irq domain for MAX77693 MUIC device */ 1128 1128 for (i = 0; i < ARRAY_SIZE(muic_irqs); i++) { 1129 1129 struct max77693_muic_irq *muic_irq = &muic_irqs[i]; 1130 - unsigned int virq = 0; 1130 + int virq; 1131 1131 1132 1132 virq = regmap_irq_get_virq(max77693->irq_data_muic, 1133 1133 muic_irq->irq); 1134 - if (!virq) 1134 + if (virq <= 0) 1135 1135 return -EINVAL; 1136 1136 muic_irq->virq = virq; 1137 1137