Skip to content

Commit

Permalink
ALSA: usb-audio: fix return values
Browse files Browse the repository at this point in the history
-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>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Daniel Mack authored and Takashi Iwai committed May 27, 2010
1 parent 74754f9 commit 8d09124
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sound/usb/format.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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;
Expand Down

0 comments on commit 8d09124

Please sign in to comment.