From: Lars Poeschel <poeschel@lemonage.de>
To: Samuel Ortiz <sameo@linux.intel.com>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH for-next] mfd: viperboard: do version query in dma memory
Date: Mon, 26 Nov 2012 11:24:53 +0100 [thread overview]
Message-ID: <201211261124.53774.poeschel@lemonage.de> (raw)
From: Lars Poeschel <poeschel@lemonage.de>
The query for the viperboard version was done with memory buffer
on the stack but usb transfers need dma capable memory buffer.
This is fixed now.
Signed-off-by: Lars Poeschel <poeschel@lemonage.de>
---
drivers/mfd/viperboard.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/mfd/viperboard.c b/drivers/mfd/viperboard.c
index 276122b..af2a670 100644
--- a/drivers/mfd/viperboard.c
+++ b/drivers/mfd/viperboard.c
@@ -56,7 +56,6 @@ static int vprbrd_probe(struct usb_interface *interface,
u16 version = 0;
int pipe, ret;
- unsigned char buf[1];
/* allocate memory for our device state and initialize it */
vb = kzalloc(sizeof(*vb), GFP_KERNEL);
@@ -76,17 +75,17 @@ static int vprbrd_probe(struct usb_interface *interface,
/* get version information, major first, minor then */
pipe = usb_rcvctrlpipe(vb->usb_dev, 0);
ret = usb_control_msg(vb->usb_dev, pipe, VPRBRD_USB_REQUEST_MAJOR,
- VPRBRD_USB_TYPE_IN, 0x0000, 0x0000, buf, 1,
+ VPRBRD_USB_TYPE_IN, 0x0000, 0x0000, vb->buf, 1,
VPRBRD_USB_TIMEOUT_MS);
if (ret == 1)
- version = buf[0];
+ version = vb->buf[0];
ret = usb_control_msg(vb->usb_dev, pipe, VPRBRD_USB_REQUEST_MINOR,
- VPRBRD_USB_TYPE_IN, 0x0000, 0x0000, buf, 1,
+ VPRBRD_USB_TYPE_IN, 0x0000, 0x0000, vb->buf, 1,
VPRBRD_USB_TIMEOUT_MS);
if (ret == 1) {
version <<= 8;
- version = version | buf[0];
+ version = version | vb->buf[0];
}
dev_info(&interface->dev,
--
1.7.10.4
next reply other threads:[~2012-11-26 10:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-26 10:24 Lars Poeschel [this message]
2012-11-26 10:49 ` Samuel Ortiz
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=201211261124.53774.poeschel@lemonage.de \
--to=poeschel@lemonage.de \
--cc=linux-kernel@vger.kernel.org \
--cc=sameo@linux.intel.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
all inboxes | Powered by JetHome®