History

sound: usb: remove third argument of usb_maxpacket()

The third argument of usb_maxpacket(): in_out has been deprecated because it could be derived from the second argument (e.g. using usb_pipeout(pipe)). N.B. function usb_maxpacket() was made variadic to accommodate the transition from the old prototype with three arguments to the new one with only two arguments (so that no renaming is needed). The variadic argument is to be removed once all users of usb_maxpacket() get migrated.

Vincent Mailhol committed 4 years ago

Commit 80b2b031 parent dcd2e495 files · +9 −9Browse files

Unified · Split

5 files
  1. sound/usb/line6/pcm.c +2 −2
  2. sound/usb/midi.c +2 −2
  3. sound/usb/usx2y/usb_stream.c +3 −3
  4. sound/usb/usx2y/usbusx2yaudio.c +1 −1
  5. sound/usb/usx2y/usx2yhwdeppcm.c +1 −1
sound/usb/line6/pcm.c+2−2
@@ -552,10 +552,10 @@ int line6_init_pcm(struct usb_line6 *line6, · 551 unmodified lines
552 552
553 line6pcm->max_packet_size_in =553 line6pcm->max_packet_size_in =
554 usb_maxpacket(line6->usbdev,554 usb_maxpacket(line6->usbdev,
555 usb_rcvisocpipe(line6->usbdev, ep_read), 0);555 usb_rcvisocpipe(line6->usbdev, ep_read));
556 line6pcm->max_packet_size_out =556 line6pcm->max_packet_size_out =
557 usb_maxpacket(line6->usbdev,557 usb_maxpacket(line6->usbdev,
558 usb_sndisocpipe(line6->usbdev, ep_write), 1);558 usb_sndisocpipe(line6->usbdev, ep_write));
559 if (!line6pcm->max_packet_size_in || !line6pcm->max_packet_size_out) {559 if (!line6pcm->max_packet_size_in || !line6pcm->max_packet_size_out) {
560 dev_err(line6pcm->line6->ifcdev,560 dev_err(line6pcm->line6->ifcdev,
561 "cannot get proper max packet size\n");561 "cannot get proper max packet size\n");
sound/usb/midi.c+2−2
@@ -1285,7 +1285,7 @@ static int snd_usbmidi_in_endpoint_create(struct snd_usb_midi *umidi, · 1284 unmodified lines
1285 pipe = usb_rcvintpipe(umidi->dev, ep_info->in_ep);1285 pipe = usb_rcvintpipe(umidi->dev, ep_info->in_ep);
1286 else1286 else
1287 pipe = usb_rcvbulkpipe(umidi->dev, ep_info->in_ep);1287 pipe = usb_rcvbulkpipe(umidi->dev, ep_info->in_ep);
1288 length = usb_maxpacket(umidi->dev, pipe, 0);1288 length = usb_maxpacket(umidi->dev, pipe);
1289 for (i = 0; i < INPUT_URBS; ++i) {1289 for (i = 0; i < INPUT_URBS; ++i) {
1290 buffer = usb_alloc_coherent(umidi->dev, length, GFP_KERNEL,1290 buffer = usb_alloc_coherent(umidi->dev, length, GFP_KERNEL,
1291 &ep->urbs[i]->transfer_dma);1291 &ep->urbs[i]->transfer_dma);
@@ -1374,7 +1374,7 @@ static int snd_usbmidi_out_endpoint_create(struct snd_usb_midi *umidi, · 82 unmodified lines
1374 pipe = usb_sndbulkpipe(umidi->dev, ep_info->out_ep);1374 pipe = usb_sndbulkpipe(umidi->dev, ep_info->out_ep);
1375 switch (umidi->usb_id) {1375 switch (umidi->usb_id) {
1376 default:1376 default:
1377 ep->max_transfer = usb_maxpacket(umidi->dev, pipe, 1);1377 ep->max_transfer = usb_maxpacket(umidi->dev, pipe);
1378 break;1378 break;
1379 /*1379 /*
1380 * Various chips declare a packet size larger than 4 bytes, but1380 * Various chips declare a packet size larger than 4 bytes, but
sound/usb/usx2y/usb_stream.c+3−3
@@ -51,7 +51,7 @@ static int init_pipe_urbs(struct usb_stream_kernel *sk, · 50 unmodified lines
51{51{
52 int u, p;52 int u, p;
53 int maxpacket = use_packsize ?53 int maxpacket = use_packsize ?
54 use_packsize : usb_maxpacket(dev, pipe, usb_pipeout(pipe));54 use_packsize : usb_maxpacket(dev, pipe);
55 int transfer_length = maxpacket * sk->n_o_ps;55 int transfer_length = maxpacket * sk->n_o_ps;
56 56
57 for (u = 0; u < USB_STREAM_NURBS;57 for (u = 0; u < USB_STREAM_NURBS;
@@ -171,7 +171,7 @@ struct usb_stream *usb_stream_new(struct usb_stream_kernel *sk, · 113 unmodified lines
171 out_pipe = usb_sndisocpipe(dev, out_endpoint);171 out_pipe = usb_sndisocpipe(dev, out_endpoint);
172 172
173 max_packsize = use_packsize ?173 max_packsize = use_packsize ?
174 use_packsize : usb_maxpacket(dev, in_pipe, 0);174 use_packsize : usb_maxpacket(dev, in_pipe);
175 175
176 /*176 /*
177 t_period = period_frames / sample_rate177 t_period = period_frames / sample_rate
@@ -187,7 +187,7 @@ struct usb_stream *usb_stream_new(struct usb_stream_kernel *sk, · 9 unmodified lines
187 read_size += packets * USB_STREAM_URBDEPTH *187 read_size += packets * USB_STREAM_URBDEPTH *
188 (max_packsize + sizeof(struct usb_stream_packet));188 (max_packsize + sizeof(struct usb_stream_packet));
189 189
190 max_packsize = usb_maxpacket(dev, out_pipe, 1);190 max_packsize = usb_maxpacket(dev, out_pipe);
191 write_size = max_packsize * packets * USB_STREAM_URBDEPTH;191 write_size = max_packsize * packets * USB_STREAM_URBDEPTH;
192 192
193 if (read_size >= 256*PAGE_SIZE || write_size >= 256*PAGE_SIZE) {193 if (read_size >= 256*PAGE_SIZE || write_size >= 256*PAGE_SIZE) {
sound/usb/usx2y/usbusx2yaudio.c+1−1
@@ -421,7 +421,7 @@ static int usx2y_urbs_allocate(struct snd_usx2y_substream *subs) · 420 unmodified lines
421 421
422 pipe = is_playback ? usb_sndisocpipe(dev, subs->endpoint) :422 pipe = is_playback ? usb_sndisocpipe(dev, subs->endpoint) :
423 usb_rcvisocpipe(dev, subs->endpoint);423 usb_rcvisocpipe(dev, subs->endpoint);
424 subs->maxpacksize = usb_maxpacket(dev, pipe, is_playback);424 subs->maxpacksize = usb_maxpacket(dev, pipe);
425 if (!subs->maxpacksize)425 if (!subs->maxpacksize)
426 return -EINVAL;426 return -EINVAL;
427 427
sound/usb/usx2y/usx2yhwdeppcm.c+1−1
@@ -321,7 +321,7 @@ static int usx2y_usbpcm_urbs_allocate(struct snd_usx2y_substream *subs) · 320 unmodified lines
321 321
322 pipe = is_playback ? usb_sndisocpipe(dev, subs->endpoint) :322 pipe = is_playback ? usb_sndisocpipe(dev, subs->endpoint) :
323 usb_rcvisocpipe(dev, subs->endpoint);323 usb_rcvisocpipe(dev, subs->endpoint);
324 subs->maxpacksize = usb_maxpacket(dev, pipe, is_playback);324 subs->maxpacksize = usb_maxpacket(dev, pipe);
325 if (!subs->maxpacksize)325 if (!subs->maxpacksize)
326 return -EINVAL;326 return -EINVAL;
327 327

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t