Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1411044 > unrolled thread

[PATCH v7 4/6] extcon: max8997: Fix handling error code of regmap_irq_get_virq()

Started byKrzysztof Kozlowski <k.kozlowski@samsung.com>
First post2016-06-01 12:00 +0200
Last post2016-06-01 12:00 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v7 4/6] extcon: max8997: Fix handling error code of  regmap_irq_get_virq() Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2016-06-01 12:00 +0200

#1411044 — [PATCH v7 4/6] extcon: max8997: Fix handling error code of regmap_irq_get_virq()

FromKrzysztof Kozlowski <k.kozlowski@samsung.com>
Date2016-06-01 12:00 +0200
Subject[PATCH v7 4/6] extcon: max8997: Fix handling error code of regmap_irq_get_virq()
Message-ID<rFb6q-6Mh-29@gated-at.bofh.it>
The regmap_irq_get_virq() can return negative ERRNO, so its result
should not be stored in unsigned int because error would be ignored.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
---
 drivers/extcon/extcon-max8997.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/extcon/extcon-max8997.c b/drivers/extcon/extcon-max8997.c
index 68754ac2c8ea..0afa3e8b5dc3 100644
--- a/drivers/extcon/extcon-max8997.c
+++ b/drivers/extcon/extcon-max8997.c
@@ -660,11 +660,11 @@ static int max8997_muic_probe(struct platform_device *pdev)
 
 	for (i = 0; i < ARRAY_SIZE(muic_irqs); i++) {
 		struct max8997_muic_irq *muic_irq = &muic_irqs[i];
-		unsigned int virq = 0;
+		int virq = 0;
 
 		virq = regmap_irq_get_virq(max8997->irq_data_muic,
 					muic_irq->irq);
-		if (!virq) {
+		if (virq <= 0) {
 			ret = -EINVAL;
 			goto err_irq;
 		}
-- 
1.9.1

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web