From: Bartosz Golaszewski Date: Mon, 27 Nov 2017 10:48:52 +0000 (+0100) Subject: gpio: mockup: modify the return value check for devm_irq_sim_init() X-Git-Tag: v4.16-rc1~135^2~57 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=1e0dca677b9c780e90e708ac3f884c54dba94b18;p=linux.git gpio: mockup: modify the return value check for devm_irq_sim_init() As discussed with Marc Zyngier: irq_sim_init() and its devres variant should return the base of the allocated interrupt range on success rather than 0. This will be modified later - first, change the way users handle the return value of these routines. Signed-off-by: Bartosz Golaszewski Signed-off-by: Linus Walleij --- diff --git a/drivers/gpio/gpio-mockup.c b/drivers/gpio/gpio-mockup.c index cbc823e43151..0abb53038ba8 100644 --- a/drivers/gpio/gpio-mockup.c +++ b/drivers/gpio/gpio-mockup.c @@ -297,7 +297,7 @@ static int gpio_mockup_probe(struct platform_device *pdev) } rv = devm_irq_sim_init(dev, &chip->irqsim, gc->ngpio); - if (rv) + if (rv < 0) return rv; rv = devm_gpiochip_add_data(dev, &chip->gc, chip);