summaryrefslogtreecommitdiff
path: root/sound/usb/quirks.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2020-11-23 09:53:33 +0100
committerTakashi Iwai <tiwai@suse.de>2020-11-23 15:15:36 +0100
commitcab941b7e5cf054502b01f776db724400ee5c1b6 (patch)
treedc80dec664d8f67b7ce213bd0d7cfb3b7cf42717 /sound/usb/quirks.c
parentc15871e17fc6efb98176b92b4152019876dbec24 (diff)
ALSA: usb-audio: Constify audioformat pointer references
The audioformat is referred in many places but most of usages are read-only. Let's add const prefix in the possible places. Tested-by: Keith Milner <kamilner@superlative.org> Tested-by: Dylan Robinson <dylan_robinson@motu.com> Link: https://lore.kernel.org/r/20201123085347.19667-28-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/quirks.c')
-rw-r--r--sound/usb/quirks.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
index 7e7f258011ff..5510c8a98447 100644
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -1375,7 +1375,8 @@ int snd_usb_apply_boot_quirk_once(struct usb_device *dev,
/*
* check if the device uses big-endian samples
*/
-int snd_usb_is_big_endian_format(struct snd_usb_audio *chip, struct audioformat *fp)
+int snd_usb_is_big_endian_format(struct snd_usb_audio *chip,
+ const struct audioformat *fp)
{
/* it depends on altsetting whether the device is big-endian or not */
switch (chip->usb_id) {
@@ -1414,7 +1415,7 @@ enum {
};
static void set_format_emu_quirk(struct snd_usb_substream *subs,
- struct audioformat *fmt)
+ const struct audioformat *fmt)
{
unsigned char emu_samplerate_id = 0;
@@ -1476,7 +1477,7 @@ static int pioneer_djm_set_format_quirk(struct snd_usb_substream *subs)
}
void snd_usb_set_format_quirk(struct snd_usb_substream *subs,
- struct audioformat *fmt)
+ const struct audioformat *fmt)
{
switch (subs->stream->chip->usb_id) {
case USB_ID(0x041e, 0x3f02): /* E-Mu 0202 USB */
@@ -1543,7 +1544,7 @@ static bool is_itf_usb_dsd_dac(unsigned int id)
}
int snd_usb_select_mode_quirk(struct snd_usb_audio *chip,
- struct audioformat *fmt)
+ const struct audioformat *fmt)
{
struct usb_device *dev = chip->dev;
int err;