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.
Unified · Split
| @@ -552,10 +552,10 @@ int line6_init_pcm(struct usb_line6 *line6, · 551 unmodified lines | ||
| 552 | 552 | |
| 553 | 553 | line6pcm->max_packet_size_in = |
| 554 | 554 | usb_maxpacket(line6->usbdev, |
| 555 | − usb_rcvisocpipe(line6->usbdev, ep_read), 0); | |
| 555 | + usb_rcvisocpipe(line6->usbdev, ep_read)); | |
| 556 | 556 | line6pcm->max_packet_size_out = |
| 557 | 557 | usb_maxpacket(line6->usbdev, |
| 558 | − usb_sndisocpipe(line6->usbdev, ep_write), 1); | |
| 558 | + usb_sndisocpipe(line6->usbdev, ep_write)); | |
| 559 | 559 | if (!line6pcm->max_packet_size_in || !line6pcm->max_packet_size_out) { |
| 560 | 560 | dev_err(line6pcm->line6->ifcdev, |
| 561 | 561 | "cannot get proper max packet size\n"); |
| @@ -1285,7 +1285,7 @@ static int snd_usbmidi_in_endpoint_create(struct snd_usb_midi *umidi, · 1284 unmodified lines | ||
| 1285 | 1285 | pipe = usb_rcvintpipe(umidi->dev, ep_info->in_ep); |
| 1286 | 1286 | else |
| 1287 | 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 | 1289 | for (i = 0; i < INPUT_URBS; ++i) { |
| 1290 | 1290 | buffer = usb_alloc_coherent(umidi->dev, length, GFP_KERNEL, |
| 1291 | 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 | 1374 | pipe = usb_sndbulkpipe(umidi->dev, ep_info->out_ep); |
| 1375 | 1375 | switch (umidi->usb_id) { |
| 1376 | 1376 | default: |
| 1377 | − ep->max_transfer = usb_maxpacket(umidi->dev, pipe, 1); | |
| 1377 | + ep->max_transfer = usb_maxpacket(umidi->dev, pipe); | |
| 1378 | 1378 | break; |
| 1379 | 1379 | /* |
| 1380 | 1380 | * Various chips declare a packet size larger than 4 bytes, but |
| @@ -51,7 +51,7 @@ static int init_pipe_urbs(struct usb_stream_kernel *sk, · 50 unmodified lines | ||
| 51 | 51 | { |
| 52 | 52 | int u, p; |
| 53 | 53 | int maxpacket = use_packsize ? |
| 54 | − use_packsize : usb_maxpacket(dev, pipe, usb_pipeout(pipe)); | |
| 54 | + use_packsize : usb_maxpacket(dev, pipe); | |
| 55 | 55 | int transfer_length = maxpacket * sk->n_o_ps; |
| 56 | 56 | |
| 57 | 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 | 171 | out_pipe = usb_sndisocpipe(dev, out_endpoint); |
| 172 | 172 | |
| 173 | 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 | 177 | 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 | 187 | read_size += packets * USB_STREAM_URBDEPTH * |
| 188 | 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 | 191 | write_size = max_packsize * packets * USB_STREAM_URBDEPTH; |
| 192 | 192 | |
| 193 | 193 | if (read_size >= 256*PAGE_SIZE || write_size >= 256*PAGE_SIZE) { |
| @@ -421,7 +421,7 @@ static int usx2y_urbs_allocate(struct snd_usx2y_substream *subs) · 420 unmodified lines | ||
| 421 | 421 | |
| 422 | 422 | pipe = is_playback ? usb_sndisocpipe(dev, subs->endpoint) : |
| 423 | 423 | usb_rcvisocpipe(dev, subs->endpoint); |
| 424 | − subs->maxpacksize = usb_maxpacket(dev, pipe, is_playback); | |
| 424 | + subs->maxpacksize = usb_maxpacket(dev, pipe); | |
| 425 | 425 | if (!subs->maxpacksize) |
| 426 | 426 | return -EINVAL; |
| 427 | 427 | |
| @@ -321,7 +321,7 @@ static int usx2y_usbpcm_urbs_allocate(struct snd_usx2y_substream *subs) · 320 unmodified lines | ||
| 321 | 321 | |
| 322 | 322 | pipe = is_playback ? usb_sndisocpipe(dev, subs->endpoint) : |
| 323 | 323 | usb_rcvisocpipe(dev, subs->endpoint); |
| 324 | − subs->maxpacksize = usb_maxpacket(dev, pipe, is_playback); | |
| 324 | + subs->maxpacksize = usb_maxpacket(dev, pipe); | |
| 325 | 325 | if (!subs->maxpacksize) |
| 326 | 326 | return -EINVAL; |
| 327 | 327 | |