linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Welling <mwelling@ieee.org>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	linux-next@vger.kernel.org, linux-kernel@vger.kernel.org,
	Michael Stickel <ms@mycable.de>
Subject: Re: linux-next: manual merge of the gpio tree with Linus' tree
Date: Wed, 28 May 2014 08:38:32 -0500	[thread overview]
Message-ID: <20140528133832.GA2541@deathray> (raw)
In-Reply-To: <20140528190011.302a2e52@canb.auug.org.au>

On Wed, May 28, 2014 at 07:00:11PM +1000, Stephen Rothwell wrote:
> 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).
> 
> -- 
> Cheers,
> Stephen Rothwell                    sfr@canb.auug.org.au
> 
> 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);


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?

  reply	other threads:[~2014-05-28 13:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-28  9:00 linux-next: manual merge of the gpio tree with Linus' tree Stephen Rothwell
2014-05-28 13:38 ` Michael Welling [this message]
2014-05-28 15:34   ` Michael Stickel
  -- strict thread matches above, loose matches on Subject: below --
2020-04-01  4:03 Stephen Rothwell
2012-05-14  8:31 Stephen Rothwell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140528133832.GA2541@deathray \
    --to=mwelling@ieee.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=ms@mycable.de \
    --cc=sfr@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).