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@gmail.com>
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
Link: https://lore.kernel.org/r/20200709171203.12950-5-digetx@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
 
 {
        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)