[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20121219162433.1E1E43E0BCF@localhost>
Date: Wed, 19 Dec 2012 16:24:33 +0000
From: Grant Likely <grant.likely@...retlab.ca>
To: Laxman Dewangan <ldewangan@...dia.com>,
broonie@...nsource.wolfsonmicro.com
Cc: ben-linux@...ff.org, kgene.kim@...sung.com, baohua.song@....com,
linux-kernel@...r.kernel.org,
spi-devel-general@...ts.sourceforge.net,
linux-samsung-soc@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, jonas.gorski@...il.com,
linux-tegra@...r.kernel.org, Laxman Dewangan <ldewangan@...dia.com>
Subject: Re: [PATCH V2] spi: remove check for bits_per_word on transfer from low level driver
On Tue, 18 Dec 2012 14:25:43 +0530, Laxman Dewangan <ldewangan@...dia.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@...dia.com>
[...]
> diff --git a/drivers/spi/spi-txx9.c b/drivers/spi/spi-txx9.c
> index d5a3cbb..550b5f4 100644
> --- a/drivers/spi/spi-txx9.c
> +++ b/drivers/spi/spi-txx9.c
> @@ -189,9 +189,8 @@ static void txx9spi_work_one(struct txx9spi *c, struct spi_message *m)
> unsigned int len = t->len;
> unsigned int wsize;
> 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;
> wsize = bits_per_word >> 3; /* in bytes */
>
> 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.
g.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists