summaryrefslogtreecommitdiff
path: root/sound/usb/usx2y
diff options
context:
space:
mode:
Diffstat (limited to 'sound/usb/usx2y')
-rw-r--r--sound/usb/usx2y/Makefile1
-rw-r--r--sound/usb/usx2y/us122l.c12
-rw-r--r--sound/usb/usx2y/us122l.h1
-rw-r--r--sound/usb/usx2y/usX2Yhwdep.h1
-rw-r--r--sound/usb/usx2y/usb_stream.c28
-rw-r--r--sound/usb/usx2y/usb_stream.h1
-rw-r--r--sound/usb/usx2y/usbusx2y.c2
-rw-r--r--sound/usb/usx2y/usbusx2y.h1
-rw-r--r--sound/usb/usx2y/usbusx2yaudio.c11
-rw-r--r--sound/usb/usx2y/usx2yhwdeppcm.c2
-rw-r--r--sound/usb/usx2y/usx2yhwdeppcm.h1
11 files changed, 35 insertions, 26 deletions
diff --git a/sound/usb/usx2y/Makefile b/sound/usb/usx2y/Makefile
index 748933054b6c..cc4c2f1efab2 100644
--- a/sound/usb/usx2y/Makefile
+++ b/sound/usb/usx2y/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
snd-usb-usx2y-objs := usbusx2y.o usX2Yhwdep.o usx2yhwdeppcm.o
snd-usb-us122l-objs := us122l.o
diff --git a/sound/usb/usx2y/us122l.c b/sound/usb/usx2y/us122l.c
index a33e31b2fc2f..159da1f3924e 100644
--- a/sound/usb/usx2y/us122l.c
+++ b/sound/usb/usx2y/us122l.c
@@ -508,8 +508,7 @@ static bool us122l_create_card(struct snd_card *card)
err = us122l_create_usbmidi(card);
if (err < 0) {
snd_printk(KERN_ERR "us122l_create_usbmidi error %i \n", err);
- us122l_stop(us122l);
- return false;
+ goto stop;
}
err = usb_stream_hwdep_new(card);
if (err < 0) {
@@ -518,10 +517,13 @@ static bool us122l_create_card(struct snd_card *card)
list_for_each(p, &us122l->midi_list)
snd_usbmidi_disconnect(p);
- us122l_stop(us122l);
- return false;
+ goto stop;
}
return true;
+
+stop:
+ us122l_stop(us122l);
+ return false;
}
static void snd_us122l_free(struct snd_card *card)
@@ -736,7 +738,7 @@ unlock:
return err;
}
-static struct usb_device_id snd_us122l_usb_id_table[] = {
+static const struct usb_device_id snd_us122l_usb_id_table[] = {
{
.match_flags = USB_DEVICE_ID_MATCH_DEVICE,
.idVendor = 0x0644,
diff --git a/sound/usb/usx2y/us122l.h b/sound/usb/usx2y/us122l.h
index 3e2a2d0041ee..34bea99d343c 100644
--- a/sound/usb/usx2y/us122l.h
+++ b/sound/usb/usx2y/us122l.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef US122L_H
#define US122L_H
diff --git a/sound/usb/usx2y/usX2Yhwdep.h b/sound/usb/usx2y/usX2Yhwdep.h
index c095d5bf1220..457199b5ed03 100644
--- a/sound/usb/usx2y/usX2Yhwdep.h
+++ b/sound/usb/usx2y/usX2Yhwdep.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef USX2YHWDEP_H
#define USX2YHWDEP_H
diff --git a/sound/usb/usx2y/usb_stream.c b/sound/usb/usx2y/usb_stream.c
index bf618e1500ac..e229abd21652 100644
--- a/sound/usb/usx2y/usb_stream.c
+++ b/sound/usb/usx2y/usb_stream.c
@@ -191,7 +191,8 @@ struct usb_stream *usb_stream_new(struct usb_stream_kernel *sk,
}
pg = get_order(read_size);
- sk->s = (void *) __get_free_pages(GFP_KERNEL|__GFP_COMP|__GFP_ZERO, pg);
+ sk->s = (void *) __get_free_pages(GFP_KERNEL|__GFP_COMP|__GFP_ZERO|
+ __GFP_NOWARN, pg);
if (!sk->s) {
snd_printk(KERN_WARNING "couldn't __get_free_pages()\n");
goto out;
@@ -211,7 +212,8 @@ struct usb_stream *usb_stream_new(struct usb_stream_kernel *sk,
pg = get_order(write_size);
sk->write_page =
- (void *)__get_free_pages(GFP_KERNEL|__GFP_COMP|__GFP_ZERO, pg);
+ (void *)__get_free_pages(GFP_KERNEL|__GFP_COMP|__GFP_ZERO|
+ __GFP_NOWARN, pg);
if (!sk->write_page) {
snd_printk(KERN_WARNING "couldn't __get_free_pages()\n");
usb_stream_free(sk);
@@ -352,20 +354,22 @@ static int submit_urbs(struct usb_stream_kernel *sk,
int err;
prepare_inurb(sk->idle_outurb->number_of_packets, sk->idle_inurb);
err = usb_submit_urb(sk->idle_inurb, GFP_ATOMIC);
- if (err < 0) {
- snd_printk(KERN_ERR "%i\n", err);
- return err;
- }
+ if (err < 0)
+ goto report_failure;
+
sk->idle_inurb = sk->completed_inurb;
sk->completed_inurb = inurb;
err = usb_submit_urb(sk->idle_outurb, GFP_ATOMIC);
- if (err < 0) {
- snd_printk(KERN_ERR "%i\n", err);
- return err;
- }
+ if (err < 0)
+ goto report_failure;
+
sk->idle_outurb = sk->completed_outurb;
sk->completed_outurb = outurb;
return 0;
+
+report_failure:
+ snd_printk(KERN_ERR "%i\n", err);
+ return err;
}
#ifdef DEBUG_LOOP_BACK
@@ -625,9 +629,9 @@ static void i_capture_start(struct urb *urb)
urb->iso_frame_desc[0].actual_length);
for (pack = 1; pack < urb->number_of_packets; ++pack) {
int l = urb->iso_frame_desc[pack].actual_length;
- printk(" %i", l);
+ printk(KERN_CONT " %i", l);
}
- printk("\n");
+ printk(KERN_CONT "\n");
}
#endif
if (!empty && s->state < usb_stream_sync1)
diff --git a/sound/usb/usx2y/usb_stream.h b/sound/usb/usx2y/usb_stream.h
index 90369001eab6..851358a8d709 100644
--- a/sound/usb/usx2y/usb_stream.h
+++ b/sound/usb/usx2y/usb_stream.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __USB_STREAM_H
#define __USB_STREAM_H
diff --git a/sound/usb/usx2y/usbusx2y.c b/sound/usb/usx2y/usbusx2y.c
index 91e0e2a4808c..4569c0efac0a 100644
--- a/sound/usb/usx2y/usbusx2y.c
+++ b/sound/usb/usx2y/usbusx2y.c
@@ -313,7 +313,7 @@ static void usX2Y_unlinkSeq(struct snd_usX2Y_AsyncSeq *S)
}
-static struct usb_device_id snd_usX2Y_usb_id_table[] = {
+static const struct usb_device_id snd_usX2Y_usb_id_table[] = {
{
.match_flags = USB_DEVICE_ID_MATCH_DEVICE,
.idVendor = 0x1604,
diff --git a/sound/usb/usx2y/usbusx2y.h b/sound/usb/usx2y/usbusx2y.h
index 6ae6b0806938..e0f77172ce8f 100644
--- a/sound/usb/usx2y/usbusx2y.h
+++ b/sound/usb/usx2y/usbusx2y.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef USBUSX2Y_H
#define USBUSX2Y_H
#include "../usbaudio.h"
diff --git a/sound/usb/usx2y/usbusx2yaudio.c b/sound/usb/usx2y/usbusx2yaudio.c
index dd40ca9d858a..f93b355756e6 100644
--- a/sound/usb/usx2y/usbusx2yaudio.c
+++ b/sound/usb/usx2y/usbusx2yaudio.c
@@ -419,10 +419,8 @@ static int usX2Y_urbs_allocate(struct snd_usX2Y_substream *subs)
if (is_playback && NULL == subs->tmpbuf) { /* allocate a temporary buffer for playback */
subs->tmpbuf = kcalloc(nr_of_packs(), subs->maxpacksize, GFP_KERNEL);
- if (NULL == subs->tmpbuf) {
- snd_printk(KERN_ERR "cannot malloc tmpbuf\n");
+ if (!subs->tmpbuf)
return -ENOMEM;
- }
}
/* allocate and initialize data urbs */
for (i = 0; i < NRURBS; i++) {
@@ -907,7 +905,7 @@ static int snd_usX2Y_pcm_close(struct snd_pcm_substream *substream)
}
-static struct snd_pcm_ops snd_usX2Y_pcm_ops =
+static const struct snd_pcm_ops snd_usX2Y_pcm_ops =
{
.open = snd_usX2Y_pcm_open,
.close = snd_usX2Y_pcm_close,
@@ -949,10 +947,9 @@ static int usX2Y_audio_stream_new(struct snd_card *card, int playback_endpoint,
for (i = playback_endpoint ? SNDRV_PCM_STREAM_PLAYBACK : SNDRV_PCM_STREAM_CAPTURE;
i <= SNDRV_PCM_STREAM_CAPTURE; ++i) {
usX2Y_substream[i] = kzalloc(sizeof(struct snd_usX2Y_substream), GFP_KERNEL);
- if (NULL == usX2Y_substream[i]) {
- snd_printk(KERN_ERR "cannot malloc\n");
+ if (!usX2Y_substream[i])
return -ENOMEM;
- }
+
usX2Y_substream[i]->usX2Y = usX2Y(card);
}
diff --git a/sound/usb/usx2y/usx2yhwdeppcm.c b/sound/usb/usx2y/usx2yhwdeppcm.c
index d51c7fd7835b..0d050528a4e1 100644
--- a/sound/usb/usx2y/usx2yhwdeppcm.c
+++ b/sound/usb/usx2y/usx2yhwdeppcm.c
@@ -587,7 +587,7 @@ static int snd_usX2Y_usbpcm_close(struct snd_pcm_substream *substream)
}
-static struct snd_pcm_ops snd_usX2Y_usbpcm_ops =
+static const struct snd_pcm_ops snd_usX2Y_usbpcm_ops =
{
.open = snd_usX2Y_usbpcm_open,
.close = snd_usX2Y_usbpcm_close,
diff --git a/sound/usb/usx2y/usx2yhwdeppcm.h b/sound/usb/usx2y/usx2yhwdeppcm.h
index 9c4fb84b2aa0..eb5a46466f0e 100644
--- a/sound/usb/usx2y/usx2yhwdeppcm.h
+++ b/sound/usb/usx2y/usx2yhwdeppcm.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#define MAXPACK 50
#define MAXBUFFERMS 100
#define MAXSTRIDE 3