[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200709171203.12950-5-digetx@gmail.com>
Date: Thu, 9 Jul 2020 20:12:01 +0300
From: Dmitry Osipenko <digetx@...il.com>
To: Thierry Reding <thierry.reding@...il.com>,
Jonathan Hunter <jonathanh@...dia.com>,
Laxman Dewangan <ldewangan@...dia.com>,
Bartosz Golaszewski <bgolaszewski@...libre.com>,
Linus Walleij <linus.walleij@...aro.org>,
Andy Shevchenko <andy.shevchenko@...il.com>
Cc: linux-tegra@...r.kernel.org, linux-gpio@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH v4 4/6] gpio: max77620: Don't shadow error code of platform_get_irq()
The platform_get_irq() returns a positive interrupt number on success and
negative error code on failure (zero shouldn't ever happen in practice, it
would produce a noisy warning). Hence let's return the error code directly
instead of overriding it with -ENODEV.
Suggested-by: Andy Shevchenko <andy.shevchenko@...il.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@...il.com>
Acked-by: Laxman Dewangan <ldewangan@...dia.com>
Signed-off-by: Dmitry Osipenko <digetx@...il.com>
---
drivers/gpio/gpio-max77620.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/gpio/gpio-max77620.c b/drivers/gpio/gpio-max77620.c
index 39d431da2dbc..9121d2507f60 100644
--- a/drivers/gpio/gpio-max77620.c
+++ b/drivers/gpio/gpio-max77620.c
@@ -264,12 +264,14 @@ static int max77620_gpio_probe(struct platform_device *pdev)
{
struct max77620_chip *chip = dev_get_drvdata(pdev->dev.parent);
struct max77620_gpio *mgpio;
- int gpio_irq;
+ unsigned int gpio_irq;
int ret;
- gpio_irq = platform_get_irq(pdev, 0);
- if (gpio_irq <= 0)
- return -ENODEV;
+ ret = platform_get_irq(pdev, 0);
+ if (ret < 0)
+ return ret;
+
+ gpio_irq = ret;
mgpio = devm_kzalloc(&pdev->dev, sizeof(*mgpio), GFP_KERNEL);
if (!mgpio)
--
2.26.0
Powered by blists - more mailing lists