From: Grant Likely <grant.likely@secretlab.ca>
To: Laxman Dewangan <ldewangan@nvidia.com>
Cc: spi-devel-general@lists.sourceforge.net,
linux-kernel@vger.kernel.org, swarren@nvidia.com,
Laxman Dewangan <ldewangan@nvidia.com>
Subject: Re: [PATCH 1/2] spi: make sure all transfer has proper speed set
Date: Tue, 05 Feb 2013 13:11:22 +0000 [thread overview]
Message-ID: <20130205131122.8C84A3E0E27@localhost> (raw)
In-Reply-To: <1357325235-25485-1-git-send-email-ldewangan@nvidia.com>
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.
prev parent reply other threads:[~2013-02-05 13:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-04 18:47 [PATCH 1/2] spi: make sure all transfer has proper speed set Laxman Dewangan
[not found] ` <1357325235-25485-1-git-send-email-ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-01-04 18:47 ` [PATCH 2/2] spi: tegra: remove checks for valid speed Laxman Dewangan
[not found] ` <1357325235-25485-2-git-send-email-ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-02-05 13:12 ` Grant Likely
2013-02-05 13:11 ` 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=20130205131122.8C84A3E0E27@localhost \
--to=grant.likely@secretlab.ca \
--cc=ldewangan@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=spi-devel-general@lists.sourceforge.net \
--cc=swarren@nvidia.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;
as well as URLs for NNTP newsgroup(s).