diff mbox

gpio: mcp23s08: switch chip count to int

Message ID 1401261398-29794-1-git-send-email-linus.walleij@linaro.org
State Accepted
Commit 596a1c5f51e2945d036fae208b67f64a47346c68
Headers show

Commit Message

Linus Walleij May 28, 2014, 7:16 a.m. UTC
Commit 3e3bed913e8bbd78f38cefd5d575475f45c05dd0
"gpio: mcp23s08: fixed count variable for devicetree probing"
introduced a loop check to see if the number of chips were
unconsistent and going below zero counting downwards, but
this requires the counting variable to be able to be
negative, so switch the variable from unsigned to int.

Cc: Michael Stickel <ms@mycable.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/gpio/gpio-mcp23s08.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/drivers/gpio/gpio-mcp23s08.c b/drivers/gpio/gpio-mcp23s08.c
index 00fbb30b9b10..f3bee370bcf2 100644
--- a/drivers/gpio/gpio-mcp23s08.c
+++ b/drivers/gpio/gpio-mcp23s08.c
@@ -867,7 +867,7 @@  static int mcp23s08_probe(struct spi_device *spi)
 {
 	struct mcp23s08_platform_data	*pdata;
 	unsigned			addr;
-	unsigned			chips = 0;
+	int				chips = 0;
 	struct mcp23s08_driver_data	*data;
 	int				status, type;
 	unsigned			base = -1,