Skip to contentSkip to conversation

gpio: mcp23s08: Eliminates redundant checking.

PATCH In review Michael Welling 2 participants 2 messages Jun 10, 2014 – Jul 4, 2014 1 message not in the archive GPIO

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 20140606033755.GA13605@deathray

#1 lore raw

PATCH 1/1 gpio: mcp23s08: Eliminates redundant checking.

Unnecessary checking was added during the merge of the gpio branch. This patch removes the extra unnecessary checking.

---
 drivers/gpio/gpio-mcp23s08.c |    6 ------
 1 file changed, 6 deletions(-)
drivers/gpio/gpio-mcp23s08.c +0 -6
index fe7c0e2..57adbc9 100644
@@ -900,8 +900,6 @@ static int mcp23s08_probe(struct spi_device *spi)
 			if (spi_present_mask & (1 << addr))
 				chips++;
 		}
-		if (!chips)
-			return -ENODEV;
 	} else {
 		type = spi_get_device_id(spi)->driver_data;
 		pdata = dev_get_platdata(&spi->dev);
@@ -940,10 +938,6 @@ static int mcp23s08_probe(struct spi_device *spi)
 		if (!(spi_present_mask & (1 << addr)))
 			continue;
 		chips--;
-		if (chips < 0) {
-			dev_err(&spi->dev, "FATAL: invalid negative chip id\n");
-			goto fail;
-		}
 		data->mcp[addr] = &data->chip[chips];
 		status = mcp23s08_probe_one(data->mcp[addr], &spi->dev, spi,
 					    0x40 | (addr << 1), type, base,
Signature · 1 line
1.7.9.5
#2 lore raw
Quoted 4 lines · Michael Welling

Unnecessary checking was added during the merge of the gpio branch. This patch removes the extra unnecessary checking.

Applied for fixes. Sorry for the mess.

Yours,
Linus Walleij