From: Jan Nikitenko <jan.nikitenko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: [PATCH] spi_bitbang: txrx_bufs zero status fix
Date: Tue, 11 Mar 2008 11:05:10 +0100 [thread overview]
Message-ID: <47D65956.9070205@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 417 bytes --]
SPI controller drivers return number of bytes actually transfered from
bitbang->txrx_bufs() method. Returned zero number of bytes transfered
when non-zero number of bytes to transfer was requested should be
recognized as error.
The patch fixes that.
Signed-off-by: Jan Nikitenko <jan.nikitenko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
spi_bitbang.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
[-- Attachment #2: spi_bitbang-txrx_bufs-zero-status-fix.patch --]
[-- Type: text/plain, Size: 497 bytes --]
diff --git a/drivers/spi/spi_bitbang.c b/drivers/spi/spi_bitbang.c
index f7f8580..83c911b 100644
--- a/drivers/spi/spi_bitbang.c
+++ b/drivers/spi/spi_bitbang.c
@@ -345,7 +345,9 @@ static void bitbang_work(struct work_struct *work)
status = bitbang->txrx_bufs(spi, t);
}
if (status != t->len) {
- if (status > 0)
+ /* zero status, meaning zero number of bytes
+ * transfered, is also invalid in this case */
+ if (status >= 0)
status = -EMSGSIZE;
break;
}
[-- Attachment #3: Type: text/plain, Size: 228 bytes --]
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
[-- Attachment #4: Type: text/plain, Size: 210 bytes --]
_______________________________________________
spi-devel-general mailing list
spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/spi-devel-general
reply other threads:[~2008-03-11 10:05 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=47D65956.9070205@gmail.com \
--to=jan.nikitenko-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=david-b-yBeKhBN/0LDR7s880joybQ@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.