From: Nicolas Ferre <nicolas.ferre-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
To: Joachim Eastwood <manabian-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [PATCH] spi/atmel: fix speed_hz check in atmel_spi_transfer()
Date: Wed, 20 Feb 2013 08:51:48 +0100 [thread overview]
Message-ID: <51248094.90808@atmel.com> (raw)
In-Reply-To: <1361310297-28002-1-git-send-email-manabian-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
On 02/19/2013 10:44 PM, Joachim Eastwood :
> atmel_spi_transfer() would check speed_hz and fail if
> the speed was changed in the transfer. After commit
> "spi: make sure all transfer has proper speed set"
> this would happen on all transfers.
>
> Change speed_hz check to only fail if a lower speed
> than max is requested.
>
> Signed-off-by: Joachim Eastwood <manabian-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Acked-by: Nicolas Ferre <nicolas.ferre-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
Thanks for spotting this Joachim.
Bye,
> ---
> Hi Grant,
>
> Fix for spi-atmel as per your suggestion; check if
> speed_hz is less than bus max speed.
>
> regards
> Joachim Eastwood
>
> drivers/spi/spi-atmel.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
> index 656d137..80f5867 100644
> --- a/drivers/spi/spi-atmel.c
> +++ b/drivers/spi/spi-atmel.c
> @@ -847,8 +847,8 @@ static int atmel_spi_transfer(struct spi_device *spi, struct spi_message *msg)
> }
>
> /* FIXME implement these protocol options!! */
> - if (xfer->speed_hz) {
> - dev_dbg(&spi->dev, "no protocol options yet\n");
> + if (xfer->speed_hz < spi->max_speed_hz) {
> + dev_dbg(&spi->dev, "can't change speed in transfer\n");
> return -ENOPROTOOPT;
> }
>
>
--
Nicolas Ferre
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
next prev parent reply other threads:[~2013-02-20 7:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-17 11:15 spi-atmel broken in next Joachim Eastwood
[not found] ` <CAGhQ9VwoehjY4niDqcnb88va9vNLw=jFmxOnq6k0QP6GZJ4gqQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-02-17 20:12 ` Grant Likely
[not found] ` <CACxGe6u0o0V3Jm9-iyizKH5KX=dPe-CL0bH-Kc7KM_k6gAk69A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-02-19 21:44 ` [PATCH] spi/atmel: fix speed_hz check in atmel_spi_transfer() Joachim Eastwood
[not found] ` <1361310297-28002-1-git-send-email-manabian-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-02-20 7:51 ` Nicolas Ferre [this message]
[not found] ` <51248094.90808-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
2013-03-02 22:31 ` 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=51248094.90808@atmel.com \
--to=nicolas.ferre-aife0yeh4naavxtiumwx3w@public.gmane.org \
--cc=manabian-Re5JQEeQqe8AvxtiuMwx3w@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).