Skip to content

Commit 0e2f511

Browse files
Hans Verkuilmchehab
authored andcommitted
[media] sur40: set q->dev instead of allocating a context
Stop using alloc_ctx and just fill in the device pointer. Signed-off-by: Hans Verkuil <[email protected]> Cc: Florian Echtler <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 8f10c2d commit 0e2f511

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

drivers/input/touchscreen/sur40.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ struct sur40_state {
151151
struct mutex lock;
152152

153153
struct vb2_queue queue;
154-
struct vb2_alloc_ctx *alloc_ctx;
155154
struct list_head buf_list;
156155
spinlock_t qlock;
157156
int sequence;
@@ -580,19 +579,13 @@ static int sur40_probe(struct usb_interface *interface,
580579
sur40->queue = sur40_queue;
581580
sur40->queue.drv_priv = sur40;
582581
sur40->queue.lock = &sur40->lock;
582+
sur40->queue.dev = sur40->dev;
583583

584584
/* initialize the queue */
585585
error = vb2_queue_init(&sur40->queue);
586586
if (error)
587587
goto err_unreg_v4l2;
588588

589-
sur40->alloc_ctx = vb2_dma_sg_init_ctx(sur40->dev);
590-
if (IS_ERR(sur40->alloc_ctx)) {
591-
dev_err(sur40->dev, "Can't allocate buffer context");
592-
error = PTR_ERR(sur40->alloc_ctx);
593-
goto err_unreg_v4l2;
594-
}
595-
596589
sur40->vdev = sur40_video_device;
597590
sur40->vdev.v4l2_dev = &sur40->v4l2;
598591
sur40->vdev.lock = &sur40->lock;
@@ -633,7 +626,6 @@ static void sur40_disconnect(struct usb_interface *interface)
633626

634627
video_unregister_device(&sur40->vdev);
635628
v4l2_device_unregister(&sur40->v4l2);
636-
vb2_dma_sg_cleanup_ctx(sur40->alloc_ctx);
637629

638630
input_unregister_polled_device(sur40->input);
639631
input_free_polled_device(sur40->input);
@@ -655,11 +647,8 @@ static int sur40_queue_setup(struct vb2_queue *q,
655647
unsigned int *nbuffers, unsigned int *nplanes,
656648
unsigned int sizes[], void *alloc_ctxs[])
657649
{
658-
struct sur40_state *sur40 = vb2_get_drv_priv(q);
659-
660650
if (q->num_buffers + *nbuffers < 3)
661651
*nbuffers = 3 - q->num_buffers;
662-
alloc_ctxs[0] = sur40->alloc_ctx;
663652

664653
if (*nplanes)
665654
return sizes[0] < sur40_video_format.sizeimage ? -EINVAL : 0;

0 commit comments

Comments
 (0)