linux-next: manual merge of the gpio tree with Linus' tree
Hi Linus,
Today's linux-next merge of the gpio tree got a conflict in drivers/gpio/gpio-mcp23s08.c between commit 99e4b98dbe3a ("gpio:
mcp23s08: Bug fix of SPI device tree registration") from Linus' tree and commit 3e3bed913e8b ("gpio: mcp23s08: fixed count variable for devicetree probing") from the gpio tree.
I fixed it up (one way - see below) and can carry the fix as necessary (no action is required).
Signature · 24 lines
Cheers, Stephen Rothwell [email protected] diff --cc drivers/gpio/gpio-mcp23s08.c index 3d53fd6880d1,00fbb30b9b10..000000000000 --- a/drivers/gpio/gpio-mcp23s08.c +++ b/drivers/gpio/gpio-mcp23s08.c @@@ -894,11 -894,14 +894,12 @@@ static int mcp23s08_probe(struct spi_de dev_err(&spi->dev, "invalid spi-present-mask\n"); return -ENODEV; } + for (addr = 0; addr < ARRAY_SIZE(pdata->chip); addr++) { - if ((spi_present_mask & (1 << addr))) - chips++; pullups[addr] = 0; + 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);
Quoted 26 lines · Stephen Rothwell
Hi Linus,
Today's linux-next merge of the gpio tree got a conflict in
drivers/gpio/gpio-mcp23s08.cbetween commit99e4b98dbe3a("gpio:
mcp23s08: Bug fix of SPI device tree registration") from Linus' tree and commit3e3bed913e8b("gpio: mcp23s08: fixed count variable for devicetree probing") from the gpio tree.I fixed it up (one way - see below) and can carry the fix as necessary (no action is required).
Signature · 2 lines
Cheers, Stephen Rothwell [email protected]drivers/gpio/gpio-mcp23s08.c +1
-1@@@ -894,11 -894,14 +894,12 @@@ static int mcp23s08_probe(struct spi_dedev_err (&spi->dev,"invalid spi-present-mask\n" );return -ENODEV ; } +for (addr =0 ; addr <ARRAY_SIZE (pdata->chip); addr++) { -if ((spi_present_mask & (1 << addr)))
drivers/gpio/gpio-mcp23s08.c
Quoted 10 lines
drivers/gpio/gpio-mcp23s08.c +2
-1- chips++; pullups[addr] =0 ; +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);
Looking at the Linux next version, I am fairly certian that the following is redundant checking:
if (chips < 0) {
dev_err(&spi->dev, "FATAL: invalid negative chip id\n");
goto fail;
}The chips variable should equal the number of bits in the spi_present_mask variable. Or am I missing something?
Am 28.05.2014 15:38, schrieb Michael Welling:
Quoted 9 lines
Looking at the Linux next version, I am fairly certian that the following is redundant checking:
if (chips < 0) { dev_err(&spi->dev, "FATAL: invalid negative chip id\n"); goto fail; }The chips variable should equal the number of bits in the
spi_present_maskvariable. Or am I missing something?
Can be left out. Was just a paranoid check, because with the missing increment in the of path it became negative.
Signature · 14 lines
------------------------------------------------------------------------ Michael Stickel Tel. +49 4321 559 56-29 mycable GmbH Fax +49 4321 559 56-10 Gartenstrasse 10 24534 Neumuenster, Germany Email [email protected] ------------------------------------------------------------------------ mycable GmbH, Managing Director: Michael Carstens-Behrens USt-IdNr: DE 214 231 199, Amtsgericht Kiel, HRB 1797 NM ------------------------------------------------------------------------ This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this e-mail in error, please notify the sender and delete all copies from your system. ------------------------------------------------------------------------