提交 302b9562 编写于 作者: L Lars Poeschel 提交者: Samuel Ortiz

mfd: viperboard: Do version query in dma memory

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: NLars Poeschel <poeschel@lemonage.de>
Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
上级 3c39c9c6
...@@ -56,7 +56,6 @@ static int vprbrd_probe(struct usb_interface *interface, ...@@ -56,7 +56,6 @@ static int vprbrd_probe(struct usb_interface *interface,
u16 version = 0; u16 version = 0;
int pipe, ret; int pipe, ret;
unsigned char buf[1];
/* allocate memory for our device state and initialize it */ /* allocate memory for our device state and initialize it */
vb = kzalloc(sizeof(*vb), GFP_KERNEL); vb = kzalloc(sizeof(*vb), GFP_KERNEL);
...@@ -76,17 +75,17 @@ static int vprbrd_probe(struct usb_interface *interface, ...@@ -76,17 +75,17 @@ static int vprbrd_probe(struct usb_interface *interface,
/* get version information, major first, minor then */ /* get version information, major first, minor then */
pipe = usb_rcvctrlpipe(vb->usb_dev, 0); pipe = usb_rcvctrlpipe(vb->usb_dev, 0);
ret = usb_control_msg(vb->usb_dev, pipe, VPRBRD_USB_REQUEST_MAJOR, 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); VPRBRD_USB_TIMEOUT_MS);
if (ret == 1) if (ret == 1)
version = buf[0]; version = vb->buf[0];
ret = usb_control_msg(vb->usb_dev, pipe, VPRBRD_USB_REQUEST_MINOR, 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); VPRBRD_USB_TIMEOUT_MS);
if (ret == 1) { if (ret == 1) {
version <<= 8; version <<= 8;
version = version | buf[0]; version = version | vb->buf[0];
} }
dev_info(&interface->dev, dev_info(&interface->dev,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册