public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: ldewangan@nvidia•com (Laxman Dewangan)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH V2] spi: remove check for bits_per_word on transfer from low level driver
Date: Thu, 20 Dec 2012 11:33:47 +0530	[thread overview]
Message-ID: <50D2AA43.8050106@nvidia.com> (raw)
In-Reply-To: <20121219162433.1E1E43E0BCF@localhost>

On Wednesday 19 December 2012 09:54 PM, Grant Likely wrote:
> On Tue, 18 Dec 2012 14:25:43 +0530, Laxman Dewangan<ldewangan@nvidia•com>  wrote:
>> The spi core make sure that each transfer structure have the proper
>> setting for bits_per_word before calling low level transfer APIs.
>>
>> Hence it is no more require to check again in low level driver for
>> this field whether this is set correct or not. Removing such code
>> from low level driver.
>>
>> Signed-off-by: Laxman Dewangan<ldewangan@nvidia•com>
> [...]
>> */
>>
>>   		if (prev_speed_hz != speed_hz
>> @@ -316,9 +315,8 @@ static int txx9spi_transfer(struct spi_device *spi, struct spi_message *m)
>>   	/* check each transfer's parameters */
>>   	list_for_each_entry (t,&m->transfers, transfer_list) {
>>   		u32 speed_hz = t->speed_hz ? : spi->max_speed_hz;
>> -		u8 bits_per_word = t->bits_per_word ? : spi->bits_per_word;
>> +		u8 bits_per_word = t->bits_per_word;
>>
>> -		bits_per_word = bits_per_word ? : 8;
> Have you verified here that bits_per_word can never be '0' here? What is
> the path that ensures spi->bits_per_word (and hence t->bits_per_word) is
> set to 8 here?
>
> Otherwise the patch looks good. Thanks for doing this work.


When we do the spi_add_device(), the spi_setup() get called.
In spi_setup, it make  sure that spi->bits_per_word is not zero.

in spi_setup(spi.c)

if (!spi->bits_per_word)
                 spi->bits_per_word = 8;

  reply	other threads:[~2012-12-20  6:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-18  8:55 [PATCH V2] spi: remove check for bits_per_word on transfer from low level driver Laxman Dewangan
2012-12-19 16:24 ` Grant Likely
2012-12-20  6:03   ` Laxman Dewangan [this message]
2012-12-22  9:54     ` Grant Likely

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=50D2AA43.8050106@nvidia.com \
    --to=ldewangan@nvidia$(echo .)com \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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