aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/es1968.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/sound/pci/es1968.c b/sound/pci/es1968.c
index 2faf009076bb..d69b11d1f993 100644
--- a/sound/pci/es1968.c
+++ b/sound/pci/es1968.c
@@ -843,10 +843,9 @@ static void snd_es1968_bob_dec(struct es1968 *chip)
843 snd_es1968_bob_stop(chip); 843 snd_es1968_bob_stop(chip);
844 else if (chip->bob_freq > ESM_BOB_FREQ) { 844 else if (chip->bob_freq > ESM_BOB_FREQ) {
845 /* check reduction of timer frequency */ 845 /* check reduction of timer frequency */
846 struct list_head *p;
847 int max_freq = ESM_BOB_FREQ; 846 int max_freq = ESM_BOB_FREQ;
848 list_for_each(p, &chip->substream_list) { 847 struct esschan *es;
849 struct esschan *es = list_entry(p, struct esschan, list); 848 list_for_each_entry(es, &chip->substream_list, list) {
850 if (max_freq < es->bob_freq) 849 if (max_freq < es->bob_freq)
851 max_freq = es->bob_freq; 850 max_freq = es->bob_freq;
852 } 851 }
@@ -1316,12 +1315,11 @@ static struct snd_pcm_hardware snd_es1968_capture = {
1316 1315
1317static int calc_available_memory_size(struct es1968 *chip) 1316static int calc_available_memory_size(struct es1968 *chip)
1318{ 1317{
1319 struct list_head *p;
1320 int max_size = 0; 1318 int max_size = 0;
1321 1319 struct esm_memory *buf;
1320
1322 mutex_lock(&chip->memory_mutex); 1321 mutex_lock(&chip->memory_mutex);
1323 list_for_each(p, &chip->buf_list) { 1322 list_for_each_entry(buf, &chip->buf_list, list) {
1324 struct esm_memory *buf = list_entry(p, struct esm_memory, list);
1325 if (buf->empty && buf->buf.bytes > max_size) 1323 if (buf->empty && buf->buf.bytes > max_size)
1326 max_size = buf->buf.bytes; 1324 max_size = buf->buf.bytes;
1327 } 1325 }
@@ -1335,12 +1333,10 @@ static int calc_available_memory_size(struct es1968 *chip)
1335static struct esm_memory *snd_es1968_new_memory(struct es1968 *chip, int size) 1333static struct esm_memory *snd_es1968_new_memory(struct es1968 *chip, int size)
1336{ 1334{
1337 struct esm_memory *buf; 1335 struct esm_memory *buf;
1338 struct list_head *p; 1336
1339
1340 size = ALIGN(size, ESM_MEM_ALIGN); 1337 size = ALIGN(size, ESM_MEM_ALIGN);
1341 mutex_lock(&chip->memory_mutex); 1338 mutex_lock(&chip->memory_mutex);
1342 list_for_each(p, &chip->buf_list) { 1339 list_for_each_entry(buf, &chip->buf_list, list) {
1343 buf = list_entry(p, struct esm_memory, list);
1344 if (buf->empty && buf->buf.bytes >= size) 1340 if (buf->empty && buf->buf.bytes >= size)
1345 goto __found; 1341 goto __found;
1346 } 1342 }
@@ -1938,10 +1934,9 @@ static irqreturn_t snd_es1968_interrupt(int irq, void *dev_id)
1938 } 1934 }
1939 1935
1940 if (event & ESM_SOUND_IRQ) { 1936 if (event & ESM_SOUND_IRQ) {
1941 struct list_head *p; 1937 struct esschan *es;
1942 spin_lock(&chip->substream_lock); 1938 spin_lock(&chip->substream_lock);
1943 list_for_each(p, &chip->substream_list) { 1939 list_for_each_entry(es, &chip->substream_list, list) {
1944 struct esschan *es = list_entry(p, struct esschan, list);
1945 if (es->running) 1940 if (es->running)
1946 snd_es1968_update_pcm(chip, es); 1941 snd_es1968_update_pcm(chip, es);
1947 } 1942 }
@@ -2345,7 +2340,7 @@ static int es1968_resume(struct pci_dev *pci)
2345{ 2340{
2346 struct snd_card *card = pci_get_drvdata(pci); 2341 struct snd_card *card = pci_get_drvdata(pci);
2347 struct es1968 *chip = card->private_data; 2342 struct es1968 *chip = card->private_data;
2348 struct list_head *p; 2343 struct esschan *es;
2349 2344
2350 if (! chip->do_pm) 2345 if (! chip->do_pm)
2351 return 0; 2346 return 0;
@@ -2374,8 +2369,7 @@ static int es1968_resume(struct pci_dev *pci)
2374 /* restore ac97 state */ 2369 /* restore ac97 state */
2375 snd_ac97_resume(chip->ac97); 2370 snd_ac97_resume(chip->ac97);
2376 2371
2377 list_for_each(p, &chip->substream_list) { 2372 list_for_each_entry(es, &chip->substream_list, list) {
2378 struct esschan *es = list_entry(p, struct esschan, list);
2379 switch (es->mode) { 2373 switch (es->mode) {
2380 case ESM_MODE_PLAY: 2374 case ESM_MODE_PLAY:
2381 snd_es1968_playback_setup(chip, es, es->substream->runtime); 2375 snd_es1968_playback_setup(chip, es, es->substream->runtime);