mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: Wenyou Yang <wenyou.yang@atmel.com>
Cc: linux-arm-kernel@lists.infradead.org, grant.likely@secretlab.ca,
	nicolas.ferre@atmel.com, richard.genoud@gmail.com,
	JM.Lin@atmel.com, spi-devel-general@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 01/16] spi/spi-atmel: fix master->num_chipselect wrongly set.
Date: Sun, 3 Mar 2013 11:27:43 +0100	[thread overview]
Message-ID: <20130303102743.GM30595@game.jcrosoft.org> (raw)
In-Reply-To: <1361861289-30332-2-git-send-email-wenyou.yang@atmel.com>

On 14:47 Tue 26 Feb     , Wenyou Yang wrote:
> if the spi property "cs-gpios" is set as below:
> 
> 	cs-gpios = <0>, <&pioC 11 0>, <0>, <0>;
> 
> the master->num_chipselect will wrongly be set to 0,
> and the spi fail to probe.
> 
> Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
> Cc: spi-devel-general@lists.sourceforge.net
> Cc: linux-kernel@vger.kernel.org
> ---
>  drivers/spi/spi-atmel.c |    2 +-
>  drivers/spi/spi.c       |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
> index ab34497..5bf3786 100644
> --- a/drivers/spi/spi-atmel.c
> +++ b/drivers/spi/spi-atmel.c
> @@ -944,7 +944,7 @@ static int atmel_spi_probe(struct platform_device *pdev)
>  
>  	master->dev.of_node = pdev->dev.of_node;
>  	master->bus_num = pdev->id;
> -	master->num_chipselect = master->dev.of_node ? 0 : 4;
> +	master->num_chipselect = 4;
Nack

we use 0 hardware gpio we only use the cs-gpio

and you do not follow the binding

it's
	cs-gpios = < 0 0 0
	 	    &pioC 11 0>;

so the code work a expected

Best Regards,
J.
>  	master->setup = atmel_spi_setup;
>  	master->transfer = atmel_spi_transfer;
>  	master->cleanup = atmel_spi_cleanup;
> diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
> index 19ee901..d88cbef 100644
> --- a/drivers/spi/spi.c
> +++ b/drivers/spi/spi.c
> @@ -1070,7 +1070,7 @@ static int of_spi_register_master(struct spi_master *master)
>  	master->num_chipselect = max(nb, master->num_chipselect);
>  
>  	if (nb < 1)
> -		return 0;
> +		nb = master->num_chipselect;
>  
>  	cs = devm_kzalloc(&master->dev,
>  			  sizeof(int) * master->num_chipselect,
> -- 
> 1.7.9.5
> 

  parent reply	other threads:[~2013-03-03 10:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1361861289-30332-1-git-send-email-wenyou.yang@atmel.com>
2013-02-26  6:47 ` Wenyou Yang
2013-03-02 23:15   ` Grant Likely
2013-03-08  0:59     ` Yang, Wenyou
2013-03-03 10:27   ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2013-02-26  6:47 ` [PATCH v5 02/16] spi/spi-atmel: detect the capabilities of SPI core by reading the VERSION register Wenyou Yang
2013-03-03 10:28   ` Jean-Christophe PLAGNIOL-VILLARD
2013-02-26  6:47 ` [PATCH v5 03/16] spi/spi-atmel: add support transfer on CS1,2,3, not only on CS0 Wenyou Yang
2013-02-26  6:47 ` [PATCH v5 04/16] spi/spi-atmel: add physical base address Wenyou Yang
2013-02-26  6:47 ` [PATCH v5 05/16] spi/spi-atmel: call unmapping on transfers buffers Wenyou Yang
2013-02-26  6:47 ` [PATCH v5 06/16] spi/spi-atmel: status information passed through controller data Wenyou Yang
2013-02-26  6:48 ` [PATCH v5 07/16] spi/spi-atmel: add flag to controller data for lock operations Wenyou Yang
2013-02-26  6:48 ` [PATCH v5 08/16] spi/spi-atmel: add dmaengine support Wenyou Yang

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=20130303102743.GM30595@game.jcrosoft.org \
    --to=plagnioj@jcrosoft.com \
    --cc=JM.Lin@atmel.com \
    --cc=grant.likely@secretlab.ca \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicolas.ferre@atmel.com \
    --cc=richard.genoud@gmail.com \
    --cc=spi-devel-general@lists.sourceforge.net \
    --cc=wenyou.yang@atmel.com \
    /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

all inboxes | Powered by JetHome®