Skip to contentSkip to conversation

gpiolib: Fix wrong appearance of critical message in gpiochip_remove()

PATCH New Andy Shevchenko 1 participant 1 message Mar 2, 2020 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpiolib: Fix wrong appearance of critical message in gpiochip_remove()

When the commit 869233f81337 ("gpiolib: Optimize gpiochip_remove() when check for requested line") refactored a for-loop, the condition to check if we found requested line was mistakenly inverted. So, fix the condition to avoid critical message when it's not supposed to be printed.

Fixes 869233f81337 ("gpiolib: Optimize gpiochip_remove() when check for requested line")
---
 drivers/gpio/gpiolib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/gpiolib.c +1 -1
index ea2d05cfb5eb..1f986ba3502a 100644
@@ -1846,7 +1846,7 @@ void gpiochip_remove(struct gpio_chip *chip)
 	}
 	spin_unlock_irqrestore(&gpio_lock, flags);
 
-	if (i == gdev->ngpio)
+	if (i < gdev->ngpio)
 		dev_crit(&gdev->dev,
 			 "REMOVING GPIOCHIP WITH GPIOS STILL REQUESTED\n");
 
Signature · 1 line
2.25.0