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
552552
553553 line6pcm->max_packet_size_in =
554554 usb_maxpacket(line6->usbdev,
555− usb_rcvisocpipe(line6->usbdev, ep_read), 0);
555+ usb_rcvisocpipe(line6->usbdev, ep_read));
556556 line6pcm->max_packet_size_out =
557557 usb_maxpacket(line6->usbdev,
558− usb_sndisocpipe(line6->usbdev, ep_write), 1);
558+ usb_sndisocpipe(line6->usbdev, ep_write));
559559 if (!line6pcm->max_packet_size_in || !line6pcm->max_packet_size_out) {
560560 dev_err(line6pcm->line6->ifcdev,
561561 "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
12851285 pipe = usb_rcvintpipe(umidi->dev, ep_info->in_ep);
12861286 else
12871287 pipe = usb_rcvbulkpipe(umidi->dev, ep_info->in_ep);
1288− length = usb_maxpacket(umidi->dev, pipe, 0);
1288+ length = usb_maxpacket(umidi->dev, pipe);
12891289 for (i = 0; i < INPUT_URBS; ++i) {
12901290 buffer = usb_alloc_coherent(umidi->dev, length, GFP_KERNEL,
12911291 &ep->urbs[i]->transfer_dma);
@@ -1374,7 +1374,7 @@ static int snd_usbmidi_out_endpoint_create(struct snd_usb_midi *umidi, · 82 unmodified lines
13741374 pipe = usb_sndbulkpipe(umidi->dev, ep_info->out_ep);
13751375 switch (umidi->usb_id) {
13761376 default:
1377− ep->max_transfer = usb_maxpacket(umidi->dev, pipe, 1);
1377+ ep->max_transfer = usb_maxpacket(umidi->dev, pipe);
13781378 break;
13791379 /*
13801380 * 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
5151 {
5252 int u, p;
5353 int maxpacket = use_packsize ?
54− use_packsize : usb_maxpacket(dev, pipe, usb_pipeout(pipe));
54+ use_packsize : usb_maxpacket(dev, pipe);
5555 int transfer_length = maxpacket * sk->n_o_ps;
5656
5757 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
171171 out_pipe = usb_sndisocpipe(dev, out_endpoint);
172172
173173 max_packsize = use_packsize ?
174− use_packsize : usb_maxpacket(dev, in_pipe, 0);
174+ use_packsize : usb_maxpacket(dev, in_pipe);
175175
176176 /*
177177 t_period = period_frames / sample_rate
@@ -187,7 +187,7 @@ struct usb_stream *usb_stream_new(struct usb_stream_kernel *sk, · 9 unmodified lines
187187 read_size += packets * USB_STREAM_URBDEPTH *
188188 (max_packsize + sizeof(struct usb_stream_packet));
189189
190− max_packsize = usb_maxpacket(dev, out_pipe, 1);
190+ max_packsize = usb_maxpacket(dev, out_pipe);
191191 write_size = max_packsize * packets * USB_STREAM_URBDEPTH;
192192
193193 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
421421
422422 pipe = is_playback ? usb_sndisocpipe(dev, subs->endpoint) :
423423 usb_rcvisocpipe(dev, subs->endpoint);
424− subs->maxpacksize = usb_maxpacket(dev, pipe, is_playback);
424+ subs->maxpacksize = usb_maxpacket(dev, pipe);
425425 if (!subs->maxpacksize)
426426 return -EINVAL;
427427
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
321321
322322 pipe = is_playback ? usb_sndisocpipe(dev, subs->endpoint) :
323323 usb_rcvisocpipe(dev, subs->endpoint);
324− subs->maxpacksize = usb_maxpacket(dev, pipe, is_playback);
324+ subs->maxpacksize = usb_maxpacket(dev, pipe);
325325 if (!subs->maxpacksize)
326326 return -EINVAL;
327327

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