Skip to content

Commit e11b4e0

Browse files
cladischtiwai
authored andcommitted
ALSA: usb-audio: rename substream format field to altset_idx
The snd_usb_substream::format field actually contains the index of the current alternate setting, so rename it to altset_idx to avoid confusion. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent e577999 commit e11b4e0

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎sound/usb/card.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ struct snd_usb_substream {
5454
struct audioformat *cur_audiofmt; /* current audioformat pointer (for hw_params callback) */
5555
unsigned int cur_rate; /* current rate (for hw_params callback) */
5656
unsigned int period_bytes; /* current period bytes (for hw_params callback) */
57-
unsigned int format; /* USB data format */
57+
unsigned int altset_idx; /* USB data format: index of alternate setting */
5858
unsigned int datapipe; /* the data i/o pipe */
5959
unsigned int syncpipe; /* 1 - async out or adaptive in */
6060
unsigned int datainterval; /* log_2 of data packet interval */

‎sound/usb/pcm.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,19 +202,19 @@ static int set_format(struct snd_usb_substream *subs, struct audioformat *fmt)
202202
return -EIO;
203203
}
204204
subs->interface = -1;
205-
subs->format = 0;
205+
subs->altset_idx = 0;
206206
}
207207

208208
/* set interface */
209-
if (subs->interface != fmt->iface || subs->format != fmt->altset_idx) {
209+
if (subs->interface != fmt->iface || subs->altset_idx != fmt->altset_idx) {
210210
if (usb_set_interface(dev, fmt->iface, fmt->altsetting) < 0) {
211211
snd_printk(KERN_ERR "%d:%d:%d: usb_set_interface failed\n",
212212
dev->devnum, fmt->iface, fmt->altsetting);
213213
return -EIO;
214214
}
215215
snd_printdd(KERN_INFO "setting usb interface %d:%d\n", fmt->iface, fmt->altsetting);
216216
subs->interface = fmt->iface;
217-
subs->format = fmt->altset_idx;
217+
subs->altset_idx = fmt->altset_idx;
218218
}
219219

220220
/* create a data pipe */
@@ -771,7 +771,7 @@ static int snd_usb_pcm_open(struct snd_pcm_substream *substream, int direction)
771771
struct snd_usb_substream *subs = &as->substream[direction];
772772

773773
subs->interface = -1;
774-
subs->format = 0;
774+
subs->altset_idx = 0;
775775
runtime->hw = snd_usb_hardware;
776776
runtime->private_data = subs;
777777
subs->pcm_substream = substream;

‎sound/usb/proc.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ static void proc_dump_substream_status(struct snd_usb_substream *subs, struct sn
116116
unsigned int i;
117117
snd_iprintf(buffer, " Status: Running\n");
118118
snd_iprintf(buffer, " Interface = %d\n", subs->interface);
119-
snd_iprintf(buffer, " Altset = %d\n", subs->format);
119+
snd_iprintf(buffer, " Altset = %d\n", subs->altset_idx);
120120
snd_iprintf(buffer, " URBs = %d [ ", subs->nurbs);
121121
for (i = 0; i < subs->nurbs; i++)
122122
snd_iprintf(buffer, "%d ", subs->dataurb[i].packets);

0 commit comments

Comments
 (0)