mirror of
https://github.com/torvalds/linux.git
synced 2024-12-13 06:32:50 +00:00
[media] dtv5100: don't do DMA on stack
The USB control messages require DMA to work. We cannot pass a stack-allocated buffer, as it is not warranted that the stack would be into a DMA enabled area. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
This commit is contained in:
parent
a3f9f07e06
commit
8f306145df
@ -31,9 +31,14 @@ module_param_named(debug, dvb_usb_dtv5100_debug, int, 0644);
|
||||
MODULE_PARM_DESC(debug, "set debugging level" DVB_USB_DEBUG_STATUS);
|
||||
DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
|
||||
|
||||
struct dtv5100_state {
|
||||
unsigned char data[80];
|
||||
};
|
||||
|
||||
static int dtv5100_i2c_msg(struct dvb_usb_device *d, u8 addr,
|
||||
u8 *wbuf, u16 wlen, u8 *rbuf, u16 rlen)
|
||||
{
|
||||
struct dtv5100_state *st = d->priv;
|
||||
u8 request;
|
||||
u8 type;
|
||||
u16 value;
|
||||
@ -60,9 +65,10 @@ static int dtv5100_i2c_msg(struct dvb_usb_device *d, u8 addr,
|
||||
}
|
||||
index = (addr << 8) + wbuf[0];
|
||||
|
||||
memcpy(st->data, rbuf, rlen);
|
||||
msleep(1); /* avoid I2C errors */
|
||||
return usb_control_msg(d->udev, usb_rcvctrlpipe(d->udev, 0), request,
|
||||
type, value, index, rbuf, rlen,
|
||||
type, value, index, st->data, rlen,
|
||||
DTV5100_USB_TIMEOUT);
|
||||
}
|
||||
|
||||
@ -176,7 +182,7 @@ static struct dvb_usb_device_properties dtv5100_properties = {
|
||||
.caps = DVB_USB_IS_AN_I2C_ADAPTER,
|
||||
.usb_ctrl = DEVICE_SPECIFIC,
|
||||
|
||||
.size_of_priv = 0,
|
||||
.size_of_priv = sizeof(struct dtv5100_state),
|
||||
|
||||
.num_adapters = 1,
|
||||
.adapter = {{
|
||||
|
Loading…
Reference in New Issue
Block a user