Commit 49624472 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: usx2y: Constify struct snd_usb_audio_quirk entries

The quirk entries used in us122l and usx2y drivers can be declared as
const as they are read-only.

There should be no functional changes by this patch.

Link: https://lore.kernel.org/r/20200103081714.9560-52-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 37cc306b
...@@ -40,13 +40,13 @@ static int snd_us122l_card_used[SNDRV_CARDS]; ...@@ -40,13 +40,13 @@ static int snd_us122l_card_used[SNDRV_CARDS];
static int us122l_create_usbmidi(struct snd_card *card) static int us122l_create_usbmidi(struct snd_card *card)
{ {
static struct snd_usb_midi_endpoint_info quirk_data = { static const struct snd_usb_midi_endpoint_info quirk_data = {
.out_ep = 4, .out_ep = 4,
.in_ep = 3, .in_ep = 3,
.out_cables = 0x001, .out_cables = 0x001,
.in_cables = 0x001 .in_cables = 0x001
}; };
static struct snd_usb_audio_quirk quirk = { static const struct snd_usb_audio_quirk quirk = {
.vendor_name = "US122L", .vendor_name = "US122L",
.product_name = NAME_ALLCAPS, .product_name = NAME_ALLCAPS,
.ifnum = 1, .ifnum = 1,
...@@ -62,13 +62,13 @@ static int us122l_create_usbmidi(struct snd_card *card) ...@@ -62,13 +62,13 @@ static int us122l_create_usbmidi(struct snd_card *card)
static int us144_create_usbmidi(struct snd_card *card) static int us144_create_usbmidi(struct snd_card *card)
{ {
static struct snd_usb_midi_endpoint_info quirk_data = { static const struct snd_usb_midi_endpoint_info quirk_data = {
.out_ep = 4, .out_ep = 4,
.in_ep = 3, .in_ep = 3,
.out_cables = 0x001, .out_cables = 0x001,
.in_cables = 0x001 .in_cables = 0x001
}; };
static struct snd_usb_audio_quirk quirk = { static const struct snd_usb_audio_quirk quirk = {
.vendor_name = "US144", .vendor_name = "US144",
.product_name = NAME_ALLCAPS, .product_name = NAME_ALLCAPS,
.ifnum = 0, .ifnum = 0,
......
...@@ -126,26 +126,26 @@ static int snd_usX2Y_hwdep_dsp_status(struct snd_hwdep *hw, ...@@ -126,26 +126,26 @@ static int snd_usX2Y_hwdep_dsp_status(struct snd_hwdep *hw,
static int usX2Y_create_usbmidi(struct snd_card *card) static int usX2Y_create_usbmidi(struct snd_card *card)
{ {
static struct snd_usb_midi_endpoint_info quirk_data_1 = { static const struct snd_usb_midi_endpoint_info quirk_data_1 = {
.out_ep = 0x06, .out_ep = 0x06,
.in_ep = 0x06, .in_ep = 0x06,
.out_cables = 0x001, .out_cables = 0x001,
.in_cables = 0x001 .in_cables = 0x001
}; };
static struct snd_usb_audio_quirk quirk_1 = { static const struct snd_usb_audio_quirk quirk_1 = {
.vendor_name = "TASCAM", .vendor_name = "TASCAM",
.product_name = NAME_ALLCAPS, .product_name = NAME_ALLCAPS,
.ifnum = 0, .ifnum = 0,
.type = QUIRK_MIDI_FIXED_ENDPOINT, .type = QUIRK_MIDI_FIXED_ENDPOINT,
.data = &quirk_data_1 .data = &quirk_data_1
}; };
static struct snd_usb_midi_endpoint_info quirk_data_2 = { static const struct snd_usb_midi_endpoint_info quirk_data_2 = {
.out_ep = 0x06, .out_ep = 0x06,
.in_ep = 0x06, .in_ep = 0x06,
.out_cables = 0x003, .out_cables = 0x003,
.in_cables = 0x003 .in_cables = 0x003
}; };
static struct snd_usb_audio_quirk quirk_2 = { static const struct snd_usb_audio_quirk quirk_2 = {
.vendor_name = "TASCAM", .vendor_name = "TASCAM",
.product_name = "US428", .product_name = "US428",
.ifnum = 0, .ifnum = 0,
...@@ -154,7 +154,7 @@ static int usX2Y_create_usbmidi(struct snd_card *card) ...@@ -154,7 +154,7 @@ static int usX2Y_create_usbmidi(struct snd_card *card)
}; };
struct usb_device *dev = usX2Y(card)->dev; struct usb_device *dev = usX2Y(card)->dev;
struct usb_interface *iface = usb_ifnum_to_if(dev, 0); struct usb_interface *iface = usb_ifnum_to_if(dev, 0);
struct snd_usb_audio_quirk *quirk = const struct snd_usb_audio_quirk *quirk =
le16_to_cpu(dev->descriptor.idProduct) == USB_ID_US428 ? le16_to_cpu(dev->descriptor.idProduct) == USB_ID_US428 ?
&quirk_2 : &quirk_1; &quirk_2 : &quirk_1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment