linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
To: Anatolij Gustschin <agust-ynQEQJNshbs@public.gmane.org>
Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [PATCH] spi: bitbang: initialize bits_per_word as specified by spi message
Date: Fri, 3 Jun 2011 15:01:29 -0600	[thread overview]
Message-ID: <20110603210129.GK17972@ponder.secretlab.ca> (raw)
In-Reply-To: <1306946209-28553-1-git-send-email-agust-ynQEQJNshbs@public.gmane.org>

On Wed, Jun 01, 2011 at 06:36:49PM +0200, Anatolij Gustschin wrote:
> SPI protocol drivers can submit messages specifying needed bits_per_word
> parameter for a message transfer. The bitbang driver currently ignores
> bits_per_word given by a singe message and always uses master's
> bits_per_word parameter. Only use master's bits_per_word when a
> message didn't specify needed bits_per_word for ongoing transfer.
> 
> Signed-off-by: Anatolij Gustschin <agust-ynQEQJNshbs@public.gmane.org>

Looks right to me.  Merged.

g.

> ---
>  drivers/spi/spi_bitbang.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/spi/spi_bitbang.c b/drivers/spi/spi_bitbang.c
> index 14a63f6..bb38c83 100644
> --- a/drivers/spi/spi_bitbang.c
> +++ b/drivers/spi/spi_bitbang.c
> @@ -68,7 +68,7 @@ static unsigned bitbang_txrx_8(
>  	unsigned		ns,
>  	struct spi_transfer	*t
>  ) {
> -	unsigned		bits = spi->bits_per_word;
> +	unsigned		bits = t->bits_per_word ? : spi->bits_per_word;
>  	unsigned		count = t->len;
>  	const u8		*tx = t->tx_buf;
>  	u8			*rx = t->rx_buf;
> @@ -94,7 +94,7 @@ static unsigned bitbang_txrx_16(
>  	unsigned		ns,
>  	struct spi_transfer	*t
>  ) {
> -	unsigned		bits = spi->bits_per_word;
> +	unsigned		bits = t->bits_per_word ? : spi->bits_per_word;
>  	unsigned		count = t->len;
>  	const u16		*tx = t->tx_buf;
>  	u16			*rx = t->rx_buf;
> @@ -120,7 +120,7 @@ static unsigned bitbang_txrx_32(
>  	unsigned		ns,
>  	struct spi_transfer	*t
>  ) {
> -	unsigned		bits = spi->bits_per_word;
> +	unsigned		bits = t->bits_per_word ? : spi->bits_per_word;
>  	unsigned		count = t->len;
>  	const u32		*tx = t->tx_buf;
>  	u32			*rx = t->rx_buf;
> -- 
> 1.7.1
> 

------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Discover what all the cheering's about.
Get your free trial download today. 
http://p.sf.net/sfu/quest-dev2dev2 

      parent reply	other threads:[~2011-06-03 21:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-01 16:36 [PATCH] spi: bitbang: initialize bits_per_word as specified by spi message Anatolij Gustschin
     [not found] ` <1306946209-28553-1-git-send-email-agust-ynQEQJNshbs@public.gmane.org>
2011-06-03 21:01   ` Grant Likely [this message]

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=20110603210129.GK17972@ponder.secretlab.ca \
    --to=grant.likely-s3s/wqlpoipyb63q8fvjnq@public.gmane.org \
    --cc=agust-ynQEQJNshbs@public.gmane.org \
    --cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    /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).