]> git.baikalelectronics.ru Git - kernel.git/commitdiff
sound: usb: remove third argument of usb_maxpacket()
authorVincent Mailhol <mailhol.vincent@wanadoo.fr>
Thu, 17 Mar 2022 03:55:12 +0000 (12:55 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Apr 2022 08:33:53 +0000 (10:33 +0200)
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.

CC: Jaroslav Kysela <perex@perex.cz>
CC: Takashi Iwai <tiwai@suse.com>
CC: Clemens Ladisch <clemens@ladisch.de>
Acked-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Link: https://lore.kernel.org/r/20220317035514.6378-8-mailhol.vincent@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/usb/line6/pcm.c
sound/usb/midi.c
sound/usb/usx2y/usb_stream.c
sound/usb/usx2y/usbusx2yaudio.c
sound/usb/usx2y/usx2yhwdeppcm.c

index fdbdfb7bce92b0aec76181b1484f25b70a06c1f0..6a4af725aedd2c33b0a44ade0a6df8b086e44678 100644 (file)
@@ -552,10 +552,10 @@ int line6_init_pcm(struct usb_line6 *line6,
 
        line6pcm->max_packet_size_in =
                usb_maxpacket(line6->usbdev,
-                       usb_rcvisocpipe(line6->usbdev, ep_read), 0);
+                       usb_rcvisocpipe(line6->usbdev, ep_read));
        line6pcm->max_packet_size_out =
                usb_maxpacket(line6->usbdev,
-                       usb_sndisocpipe(line6->usbdev, ep_write), 1);
+                       usb_sndisocpipe(line6->usbdev, ep_write));
        if (!line6pcm->max_packet_size_in || !line6pcm->max_packet_size_out) {
                dev_err(line6pcm->line6->ifcdev,
                        "cannot get proper max packet size\n");
index 2c01649c70f619d6e9994e81bdc16c171bb6e471..fba498f9e7dce21e0f79c371d7b17fa8c315c698 100644 (file)
@@ -1285,7 +1285,7 @@ static int snd_usbmidi_in_endpoint_create(struct snd_usb_midi *umidi,
                pipe = usb_rcvintpipe(umidi->dev, ep_info->in_ep);
        else
                pipe = usb_rcvbulkpipe(umidi->dev, ep_info->in_ep);
-       length = usb_maxpacket(umidi->dev, pipe, 0);
+       length = usb_maxpacket(umidi->dev, pipe);
        for (i = 0; i < INPUT_URBS; ++i) {
                buffer = usb_alloc_coherent(umidi->dev, length, GFP_KERNEL,
                                            &ep->urbs[i]->transfer_dma);
@@ -1374,7 +1374,7 @@ static int snd_usbmidi_out_endpoint_create(struct snd_usb_midi *umidi,
                pipe = usb_sndbulkpipe(umidi->dev, ep_info->out_ep);
        switch (umidi->usb_id) {
        default:
-               ep->max_transfer = usb_maxpacket(umidi->dev, pipe, 1);
+               ep->max_transfer = usb_maxpacket(umidi->dev, pipe);
                break;
                /*
                 * Various chips declare a packet size larger than 4 bytes, but
index 9d0e44793896f6c1d6128921a8bb6a0eaf039e9d..a4d32e8a1d3663e2a1808b6c4f966674eb15b437 100644 (file)
@@ -51,7 +51,7 @@ static int init_pipe_urbs(struct usb_stream_kernel *sk,
 {
        int u, p;
        int maxpacket = use_packsize ?
-               use_packsize : usb_maxpacket(dev, pipe, usb_pipeout(pipe));
+               use_packsize : usb_maxpacket(dev, pipe);
        int transfer_length = maxpacket * sk->n_o_ps;
 
        for (u = 0; u < USB_STREAM_NURBS;
@@ -171,7 +171,7 @@ struct usb_stream *usb_stream_new(struct usb_stream_kernel *sk,
        out_pipe = usb_sndisocpipe(dev, out_endpoint);
 
        max_packsize = use_packsize ?
-               use_packsize : usb_maxpacket(dev, in_pipe, 0);
+               use_packsize : usb_maxpacket(dev, in_pipe);
 
        /*
                t_period = period_frames / sample_rate
@@ -187,7 +187,7 @@ struct usb_stream *usb_stream_new(struct usb_stream_kernel *sk,
        read_size += packets * USB_STREAM_URBDEPTH *
                (max_packsize + sizeof(struct usb_stream_packet));
 
-       max_packsize = usb_maxpacket(dev, out_pipe, 1);
+       max_packsize = usb_maxpacket(dev, out_pipe);
        write_size = max_packsize * packets * USB_STREAM_URBDEPTH;
 
        if (read_size >= 256*PAGE_SIZE || write_size >= 256*PAGE_SIZE) {
index cfc1ea53978d9ad10f7e71e3ab2c5cc4d975e1fa..9cd5e3aae4f77da68a06c66c719557161285b699 100644 (file)
@@ -421,7 +421,7 @@ static int usx2y_urbs_allocate(struct snd_usx2y_substream *subs)
 
        pipe = is_playback ? usb_sndisocpipe(dev, subs->endpoint) :
                        usb_rcvisocpipe(dev, subs->endpoint);
-       subs->maxpacksize = usb_maxpacket(dev, pipe, is_playback);
+       subs->maxpacksize = usb_maxpacket(dev, pipe);
        if (!subs->maxpacksize)
                return -EINVAL;
 
index db83522c1b492d949c3e210df1d851b2dc312a33..240349b644f38fc41f16d3737d35361bc43856b4 100644 (file)
@@ -321,7 +321,7 @@ static int usx2y_usbpcm_urbs_allocate(struct snd_usx2y_substream *subs)
 
        pipe = is_playback ? usb_sndisocpipe(dev, subs->endpoint) :
                        usb_rcvisocpipe(dev, subs->endpoint);
-       subs->maxpacksize = usb_maxpacket(dev, pipe, is_playback);
+       subs->maxpacksize = usb_maxpacket(dev, pipe);
        if (!subs->maxpacksize)
                return -EINVAL;