diff options
author | Sachin Kamat <sachin.kamat@linaro.org> | 2012-11-20 01:46:41 -0500 |
---|---|---|
committer | MyungJoo Ham <myungjoo.ham@samsung.com> | 2012-11-21 06:00:40 -0500 |
commit | 68c9274d0fd1f66c6d105c52a61268d943e30862 (patch) | |
tree | b9c580869cc52e249c9a3974907fee287452ee2f /drivers/extcon/extcon-max8997.c | |
parent | c0c078c363a578543826bb8bfc9af47c7cc9321b (diff) |
extcon: max8997: Fix incorrect error check and return value
irq_create_mapping() returns 0 if it fails to provide a valid irq number.
'ret' needs to be updated with a negative error code before returning from
probe to signal probe failure. While at it, also corrected the 'virq' type to
unsigned from signed.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
Diffstat (limited to 'drivers/extcon/extcon-max8997.c')
-rw-r--r-- | drivers/extcon/extcon-max8997.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/extcon/extcon-max8997.c b/drivers/extcon/extcon-max8997.c index 77b66b0cc8f5..a46c82f31837 100644 --- a/drivers/extcon/extcon-max8997.c +++ b/drivers/extcon/extcon-max8997.c | |||
@@ -450,11 +450,13 @@ static int __devinit max8997_muic_probe(struct platform_device *pdev) | |||
450 | 450 | ||
451 | for (i = 0; i < ARRAY_SIZE(muic_irqs); i++) { | 451 | for (i = 0; i < ARRAY_SIZE(muic_irqs); i++) { |
452 | struct max8997_muic_irq *muic_irq = &muic_irqs[i]; | 452 | struct max8997_muic_irq *muic_irq = &muic_irqs[i]; |
453 | int virq = 0; | 453 | unsigned int virq = 0; |
454 | 454 | ||
455 | virq = irq_create_mapping(max8997->irq_domain, muic_irq->irq); | 455 | virq = irq_create_mapping(max8997->irq_domain, muic_irq->irq); |
456 | if (!virq) | 456 | if (!virq) { |
457 | ret = -EINVAL; | ||
457 | goto err_irq; | 458 | goto err_irq; |
459 | } | ||
458 | muic_irq->virq = virq; | 460 | muic_irq->virq = virq; |
459 | 461 | ||
460 | ret = request_threaded_irq(virq, NULL,max8997_muic_irq_handler, | 462 | ret = request_threaded_irq(virq, NULL,max8997_muic_irq_handler, |