Skip to content

Commit

Permalink
Build fixing fl2000_streaming
Browse files Browse the repository at this point in the history
  • Loading branch information
klogg committed Sep 11, 2024
1 parent bfd7950 commit ad3af19
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions fl2000_streaming.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ static int fl2000_send_stream(struct usb_device *usb_dev, struct fl2000_stream *
int ret;
struct fl2000_stream_buf *cur_sb;
struct fl2000_stream_buf *last_sb;
struct urb *data_urb;
struct urb *urb;

data_urb = usb_alloc_urb(0, GFP_KERNEL);
if (!data_urb) {
urb = usb_alloc_urb(0, GFP_KERNEL);
if (!urb) {
dev_err(&usb_dev->dev, "Data URB allocation error");
return -ENOMEM;
}
Expand Down Expand Up @@ -201,14 +201,14 @@ static int fl2000_send_stream(struct usb_device *usb_dev, struct fl2000_stream *
/* Endpoint 1 bulk out. We store pointer to current stream buffer structure in
* transfer_buffer field of URB which is unused due to SGT
*/
usb_fill_bulk_urb(data_urb, usb_dev, usb_sndbulkpipe(usb_dev, STREAMING_EP), cur_sb,
usb_fill_bulk_urb(urb, usb_dev, usb_sndbulkpipe(usb_dev, STREAMING_EP), cur_sb,
(int)stream->buf_size, fl2000_data_completion, stream);
data_urb->interval = 0;
data_urb->sg = cur_sb->sgt.sgl;
data_urb->num_sgs = cur_sb->sgt.nents;
data_urb->transfer_flags |= URB_ZERO_PACKET;
urb->interval = 0;
urb->sg = cur_sb->sgt.sgl;
urb->num_sgs = cur_sb->sgt.nents;
urb->transfer_flags |= URB_ZERO_PACKET;

usb_anchor_urb(data_urb, &stream->anchor);
usb_anchor_urb(urb, &stream->anchor);
ret = usb_submit_urb(urb, GFP_KERNEL);
if (ret) {
dev_err(&usb_dev->dev, "Data URB error %d", ret);
Expand All @@ -217,8 +217,8 @@ static int fl2000_send_stream(struct usb_device *usb_dev, struct fl2000_stream *
list_move_tail(&cur_sb->list, &stream->render_list);
spin_unlock(&stream->list_lock);

usb_unanchor_urb(data_urb);
usb_free_urb(data_urb);
usb_unanchor_urb(urb);
usb_free_urb(urb);

/* NOTE: actually in some cases we can try and resend the URB (-EAGAIN, some -ENOMEM) */
return ret;
Expand All @@ -239,7 +239,7 @@ static void fl2000_data_completion(struct urb *urb)
list_move_tail(&cur_sb->list, &stream->render_list);
spin_unlock(&stream->list_lock);

atomic_inc(stream->urb_cnt);
atomic_inc(&stream->urb_cnt);

fl2000_drm_vblank(usb_dev);

Expand Down Expand Up @@ -276,9 +276,7 @@ static void fl2000_streaming_release(struct device *dev, void *res)
{
struct fl2000_stream *stream = res;

UNUSED(dev);

fl2000_streaming_disable(stream);
fl2000_streaming_disable(to_usb_device(dev));

fl2000_put_buffers(&stream->render_list);
}
Expand All @@ -300,13 +298,13 @@ void fl2000_streaming_compress(struct usb_device *usb_dev, void *src, unsigned i
u32 dst_line_len;
struct fl2000_stream *stream;

stream = devres_find(&usb_dev->dev, fl2000_stream_release, NULL, NULL);
stream = devres_find(&usb_dev->dev, fl2000_streaming_release, NULL, NULL);
if (!stream) {
dev_err(&usb_dev->dev, "Cannot find streaming context");
return;
}

if (list_empty(&stream->render_list)
if (list_empty(&stream->render_list))
return;

spin_lock_irq(&stream->list_lock);
Expand Down

0 comments on commit ad3af19

Please sign in to comment.