linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Mack <zonque@gmail.com>
To: Josef Ahmad <josef.ahmad@intel.com>
Cc: Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>,
	Grant Likely <grant.likely@secretlab.ca>,
	spi-devel-general@lists.sourceforge.net,
	linux-kernel@vger.kernel.org,
	Mark Brown <broonie@opensource.wolfsonmicro.com>
Subject: Re: [PATCH] spi-gpio: init CS before spi_bitbang_setup()
Date: Tue, 09 Apr 2013 19:06:32 +0200	[thread overview]
Message-ID: <51644A98.1070904@gmail.com> (raw)
In-Reply-To: <1365525613-27198-1-git-send-email-josef.ahmad@intel.com>

Cc: Mark

On 09.04.2013 18:40, Josef Ahmad wrote:
> spi_bitbang_setup() deasserts the chip select line to initialise
> the device. The chip select GPIO line is obtained from
> spi_gpio->cs_gpios[] private data.
> Currently, devices that are not registered under devicetree
> environment will call into spi_bitbang_setup() with stale
> cs_gpios[].
> 
> This patch ensures spi_gpio->cs_gpios[] is always initialised prior
> to calling spi_bitbang_setup().
> 
> Reviewed-by: Daniel Mack <zonque@gmail.com>
> Signed-off-by: Josef Ahmad <josef.ahmad@intel.com>
> ---
>  drivers/spi/spi-gpio.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/spi/spi-gpio.c b/drivers/spi/spi-gpio.c
> index c7cf0b7..0fa345c 100644
> --- a/drivers/spi/spi-gpio.c
> +++ b/drivers/spi/spi-gpio.c
> @@ -265,9 +265,9 @@ static int spi_gpio_setup(struct spi_device *spi)
>  		}
>  	}
>  	if (!status) {
> -		status = spi_bitbang_setup(spi);
>  		/* in case it was initialized from static board data */
>  		spi_gpio->cs_gpios[spi->chip_select] = cs;
> +		status = spi_bitbang_setup(spi);
>  	}
>  
>  	if (status) {
> 

  reply	other threads:[~2013-04-09 17:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-09 16:40 [PATCH] spi-gpio: init CS before spi_bitbang_setup() Josef Ahmad
2013-04-09 17:06 ` Daniel Mack [this message]
2013-04-09 17:08   ` Mark Brown
     [not found]     ` <20130409170800.GW9243-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2013-04-09 17:11       ` Daniel Mack
2013-04-09 17:32         ` Mark Brown
  -- strict thread matches above, loose matches on Subject: below --
2013-04-09 17:25 Josef Ahmad
2013-04-10 13:47 ` Mark Brown

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=51644A98.1070904@gmail.com \
    --to=zonque@gmail.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=grant.likely@secretlab.ca \
    --cc=josef.ahmad@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=spi-devel-general@lists.sourceforge.net \
    --cc=u.kleine-koenig@pengutronix.de \
    /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).