Skip to content

Commit c607e5e

Browse files
digetxlinusw
authored andcommitted
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 <[email protected]> Signed-off-by: Dmitry Osipenko <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Acked-by: Laxman Dewangan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent 78934d8 commit c607e5e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

drivers/gpio/gpio-max77620.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,12 +264,14 @@ static int max77620_gpio_probe(struct platform_device *pdev)
264264
{
265265
struct max77620_chip *chip = dev_get_drvdata(pdev->dev.parent);
266266
struct max77620_gpio *mgpio;
267-
int gpio_irq;
267+
unsigned int gpio_irq;
268268
int ret;
269269

270-
gpio_irq = platform_get_irq(pdev, 0);
271-
if (gpio_irq <= 0)
272-
return -ENODEV;
270+
ret = platform_get_irq(pdev, 0);
271+
if (ret < 0)
272+
return ret;
273+
274+
gpio_irq = ret;
273275

274276
mgpio = devm_kzalloc(&pdev->dev, sizeof(*mgpio), GFP_KERNEL);
275277
if (!mgpio)

0 commit comments

Comments
 (0)