提交 6ac454aa 编写于 作者: S Sean Young 提交者: Mauro Carvalho Chehab

[media] Minor cleanups for MCE USB

Signed-off-by: NSean Young <sean@mess.org>
Cc: Jarod Wilson <jarod@wilsonet.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 0208c15e
...@@ -417,14 +417,12 @@ struct mceusb_dev { ...@@ -417,14 +417,12 @@ struct mceusb_dev {
/* usb */ /* usb */
struct usb_device *usbdev; struct usb_device *usbdev;
struct urb *urb_in; struct urb *urb_in;
struct usb_endpoint_descriptor *usb_ep_in;
struct usb_endpoint_descriptor *usb_ep_out; struct usb_endpoint_descriptor *usb_ep_out;
/* buffers and dma */ /* buffers and dma */
unsigned char *buf_in; unsigned char *buf_in;
unsigned int len_in; unsigned int len_in;
dma_addr_t dma_in; dma_addr_t dma_in;
dma_addr_t dma_out;
enum { enum {
CMD_HEADER = 0, CMD_HEADER = 0,
...@@ -693,7 +691,7 @@ static void mceusb_dev_printdata(struct mceusb_dev *ir, char *buf, ...@@ -693,7 +691,7 @@ static void mceusb_dev_printdata(struct mceusb_dev *ir, char *buf,
dev_info(dev, "Raw IR data, %d pulse/space samples\n", ir->rem); dev_info(dev, "Raw IR data, %d pulse/space samples\n", ir->rem);
} }
static void mce_async_callback(struct urb *urb, struct pt_regs *regs) static void mce_async_callback(struct urb *urb)
{ {
struct mceusb_dev *ir; struct mceusb_dev *ir;
int len; int len;
...@@ -740,7 +738,7 @@ static void mce_request_packet(struct mceusb_dev *ir, unsigned char *data, ...@@ -740,7 +738,7 @@ static void mce_request_packet(struct mceusb_dev *ir, unsigned char *data,
pipe = usb_sndintpipe(ir->usbdev, pipe = usb_sndintpipe(ir->usbdev,
ir->usb_ep_out->bEndpointAddress); ir->usb_ep_out->bEndpointAddress);
usb_fill_int_urb(async_urb, ir->usbdev, pipe, usb_fill_int_urb(async_urb, ir->usbdev, pipe,
async_buf, size, (usb_complete_t)mce_async_callback, async_buf, size, mce_async_callback,
ir, ir->usb_ep_out->bInterval); ir, ir->usb_ep_out->bInterval);
memcpy(async_buf, data, size); memcpy(async_buf, data, size);
...@@ -1038,7 +1036,7 @@ static void mceusb_process_ir_data(struct mceusb_dev *ir, int buf_len) ...@@ -1038,7 +1036,7 @@ static void mceusb_process_ir_data(struct mceusb_dev *ir, int buf_len)
ir_raw_event_handle(ir->rc); ir_raw_event_handle(ir->rc);
} }
static void mceusb_dev_recv(struct urb *urb, struct pt_regs *regs) static void mceusb_dev_recv(struct urb *urb)
{ {
struct mceusb_dev *ir; struct mceusb_dev *ir;
int buf_len; int buf_len;
...@@ -1338,7 +1336,6 @@ static int __devinit mceusb_dev_probe(struct usb_interface *intf, ...@@ -1338,7 +1336,6 @@ static int __devinit mceusb_dev_probe(struct usb_interface *intf,
ir->model = model; ir->model = model;
/* Saving usb interface data for use by the transmitter routine */ /* Saving usb interface data for use by the transmitter routine */
ir->usb_ep_in = ep_in;
ir->usb_ep_out = ep_out; ir->usb_ep_out = ep_out;
if (dev->descriptor.iManufacturer if (dev->descriptor.iManufacturer
...@@ -1356,8 +1353,8 @@ static int __devinit mceusb_dev_probe(struct usb_interface *intf, ...@@ -1356,8 +1353,8 @@ static int __devinit mceusb_dev_probe(struct usb_interface *intf,
goto rc_dev_fail; goto rc_dev_fail;
/* wire up inbound data handler */ /* wire up inbound data handler */
usb_fill_int_urb(ir->urb_in, dev, pipe, ir->buf_in, usb_fill_int_urb(ir->urb_in, dev, pipe, ir->buf_in, maxp,
maxp, (usb_complete_t) mceusb_dev_recv, ir, ep_in->bInterval); mceusb_dev_recv, ir, ep_in->bInterval);
ir->urb_in->transfer_dma = ir->dma_in; ir->urb_in->transfer_dma = ir->dma_in;
ir->urb_in->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; ir->urb_in->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册