From: Krzysztof Kozlowski Date: Fri, 18 Apr 2014 14:47:30 +0000 (+0200) Subject: extcon: max14577: Properly handle regmap_irq_get_virq error X-Git-Tag: firefly_0821_release~176^2~3465^2~41^2~21^2~17 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=369afd4ba22f5b8de0c9229b6e62b3f9e2207034;p=firefly-linux-kernel-4.4.55.git extcon: max14577: Properly handle regmap_irq_get_virq error The regmap_irq_get_virq may return 0 or -EINVAL on error. Fail the probe in both situations. Signed-off-by: Krzysztof Kozlowski Cc: Signed-off-by: Chanwoo Choi --- diff --git a/drivers/extcon/extcon-max14577.c b/drivers/extcon/extcon-max14577.c index 4179ce1a23de..2acf7461c905 100644 --- a/drivers/extcon/extcon-max14577.c +++ b/drivers/extcon/extcon-max14577.c @@ -721,7 +721,7 @@ static int max14577_muic_probe(struct platform_device *pdev) unsigned int virq = 0; virq = regmap_irq_get_virq(max14577->irq_data, muic_irq->irq); - if (!virq) + if (virq <= 0) return -EINVAL; muic_irq->virq = virq;