From: Daniel Mack <daniel@caiaq.de>
To: alsa-devel@alsa-project.org
Cc: tiwai@suse.de, gregkh@suse.de, clemens@ladisch.de
Subject: [PATCH 2/4] ALSA: usb-audio: fix return values
Date: Wed, 26 May 2010 18:11:37 +0200 [thread overview]
Message-ID: <1274890299-8972-2-git-send-email-daniel@caiaq.de> (raw)
In-Reply-To: <1274890299-8972-1-git-send-email-daniel@caiaq.de>
-1 is not a good return value as it means -EPERM, "not permitted".
Choose -ENOTSUPP instead, which is what the code really wants to tell
its callers.
Signed-off-by: Daniel Mack <daniel@caiaq.de>
---
sound/usb/format.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/usb/format.c b/sound/usb/format.c
index caaa3ef..fe29d61 100644
--- a/sound/usb/format.c
+++ b/sound/usb/format.c
@@ -408,7 +408,7 @@ int snd_usb_parse_audio_format(struct snd_usb_audio *chip, struct audioformat *f
snd_printd(KERN_INFO "%d:%u:%d : format type %d is not supported yet\n",
chip->dev->devnum, fp->iface, fp->altsetting,
fmt->bFormatType);
- return -1;
+ return -ENOTSUPP;
}
fp->fmt_type = fmt->bFormatType;
if (err < 0)
@@ -424,7 +424,7 @@ int snd_usb_parse_audio_format(struct snd_usb_audio *chip, struct audioformat *f
if (fmt->bFormatType == UAC_FORMAT_TYPE_I &&
fp->rates != SNDRV_PCM_RATE_48000 &&
fp->rates != SNDRV_PCM_RATE_96000)
- return -1;
+ return -ENOTSUPP;
}
#endif
return 0;
--
1.7.1
next prev parent reply other threads:[~2010-05-26 16:11 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-26 16:11 [PATCH 1/4] ALSA: usb-audio: parse more format descriptors with structs Daniel Mack
2010-05-26 16:11 ` Daniel Mack [this message]
2010-05-26 16:11 ` [PATCH 3/4] ALSA: usb-audio: parse UAC2 endpoint descriptors correctly Daniel Mack
2010-05-26 16:17 ` Daniel Mack
[not found] ` <20100526204657.GB7343@suse.de>
2010-05-27 8:10 ` Takashi Iwai
2010-05-27 18:15 ` Daniel Mack
2010-05-28 5:48 ` Takashi Iwai
2010-05-26 16:11 ` [PATCH 4/4] ALSA: usb-audio: add support for UAC2 pitch control Daniel Mack
2010-05-27 8:09 ` [PATCH 1/4] ALSA: usb-audio: parse more format descriptors with structs Takashi Iwai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1274890299-8972-2-git-send-email-daniel@caiaq.de \
--to=daniel@caiaq.de \
--cc=alsa-devel@alsa-project.org \
--cc=clemens@ladisch.de \
--cc=gregkh@suse.de \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).