extcon: max14577: Properly handle regmap_irq_get_virq error

commit 369afd4ba2 upstream.

The regmap_irq_get_virq may return 0 or -EINVAL on error. Fail the probe
in both situations.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Krzysztof Kozlowski 2014-04-18 16:47:30 +02:00 committed by Greg Kroah-Hartman
parent b6687c4967
commit 57a30a41fd
1 changed files with 1 additions and 1 deletions

View File

@ -650,7 +650,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;