lkml.org 
[lkml]   [2013]   [Feb]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 1/2] spi: make sure all transfer has proper speed set
Date
On Sat, 5 Jan 2013 00:17:14 +0530, Laxman Dewangan <ldewangan@nvidia.com> wrote:
> When spi client does the spi transfer and if it does not set
> the speed for each transfer then set it as default
> of spi device in spi core before calling low level transfer.
>
> This will remove the extra check in low level driver for setting
> speed.
>
> Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>

Applied, thanks.

g.

> ---
> drivers/spi/spi.c | 6 ++++--
> 1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
> index 19ee901..9676a29 100644
> --- a/drivers/spi/spi.c
> +++ b/drivers/spi/spi.c
> @@ -1366,12 +1366,14 @@ static int __spi_async(struct spi_device *spi, struct spi_message *message)
> }
>
> /**
> - * Set transfer bits_per_word as spi device default if it is not
> - * set for this transfer.
> + * Set transfer bits_per_word and max speed as spi device default if
> + * it is not set for this transfer.
> */
> list_for_each_entry(xfer, &message->transfers, transfer_list) {
> if (!xfer->bits_per_word)
> xfer->bits_per_word = spi->bits_per_word;
> + if (!xfer->speed_hz)
> + xfer->speed_hz = spi->max_speed_hz;
> }
>
> message->spi = spi;
> --
> 1.7.1.1
>

--
Grant Likely, B.Sc, P.Eng.
Secret Lab Technologies, Ltd.


\
 
 \ /
  Last update: 2013-02-05 15:01    [W:0.040 / U:0.532 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site