LinuxTV Patchwork [v2,2/2] media: lmedm04: Move interrupt buffer to priv buffer.

login
register
mail settings
Submitter Malcolm Priestley
Date Dec. 5, 2018, 7:14 p.m.
Message ID <3c964ad4-cefd-bed0-1317-9ae3d3450b47@gmail.com>
Download mbox | patch
Permalink /patch/53339/
State Accepted
Delegated to: Sean Young
Headers show

Comments

Malcolm Priestley - Dec. 5, 2018, 7:14 p.m.
Interrupt is always present throughout life time of driver and
there is no dma element move this buffer to private area of driver.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
---
v2 removed the need for DMA transfer flags as per Sean 

 drivers/media/usb/dvb-usb-v2/lmedm04.c | 28 +++++++++-----------------
 1 file changed, 9 insertions(+), 19 deletions(-)

Patch

diff --git a/drivers/media/usb/dvb-usb-v2/lmedm04.c b/drivers/media/usb/dvb-usb-v2/lmedm04.c
index cba782261a6f..602013cf3e69 100644
--- a/drivers/media/usb/dvb-usb-v2/lmedm04.c
+++ b/drivers/media/usb/dvb-usb-v2/lmedm04.c
@@ -134,7 +134,7 @@  struct lme2510_state {
 	u8 stream_on;
 	u8 pid_size;
 	u8 pid_off;
-	void *buffer;
+	u8 int_buffer[128];
 	struct urb *lme_urb;
 	u8 usb_buffer[64];
 	/* Frontend original calls */
@@ -388,20 +388,14 @@  static int lme2510_int_read(struct dvb_usb_adapter *adap)
 	if (lme_int->lme_urb == NULL)
 			return -ENOMEM;
 
-	lme_int->buffer = usb_alloc_coherent(d->udev, 128, GFP_ATOMIC,
-					&lme_int->lme_urb->transfer_dma);
-
-	if (lme_int->buffer == NULL)
-			return -ENOMEM;
-
 	usb_fill_int_urb(lme_int->lme_urb,
-				d->udev,
-				usb_rcvintpipe(d->udev, 0xa),
-				lme_int->buffer,
-				128,
-				lme2510_int_response,
-				adap,
-				8);
+			 d->udev,
+			 usb_rcvintpipe(d->udev, 0xa),
+			 lme_int->int_buffer,
+			 sizeof(lme_int->int_buffer),
+			 lme2510_int_response,
+			 adap,
+			 8);
 
 	/* Quirk of pipe reporting PIPE_BULK but behaves as interrupt */
 	ep = usb_pipe_endpoint(d->udev, lme_int->lme_urb->pipe);
@@ -409,8 +403,6 @@  static int lme2510_int_read(struct dvb_usb_adapter *adap)
 	if (usb_endpoint_type(&ep->desc) == USB_ENDPOINT_XFER_BULK)
 		lme_int->lme_urb->pipe = usb_rcvbulkpipe(d->udev, 0xa),
 
-	lme_int->lme_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
-
 	usb_submit_urb(lme_int->lme_urb, GFP_ATOMIC);
 	info("INT Interrupt Service Started");
 
@@ -1225,10 +1217,8 @@  static void lme2510_exit(struct dvb_usb_device *d)
 		lme2510_kill_urb(&adap->stream);
 	}
 
-	if (st->lme_urb != NULL) {
+	if (st->lme_urb) {
 		usb_kill_urb(st->lme_urb);
-		usb_free_coherent(d->udev, 128, st->buffer,
-				  st->lme_urb->transfer_dma);
 		usb_free_urb(st->lme_urb);
 		info("Interrupt Service Stopped");
 	}

Privacy Policy