Commit 813bdba37560e13448b09514feadcf063f914b97
1 parent
f493e7bcaa
Exists in
master
and in
13 other branches
ALSA: intel8x0m: Use standard printk helpers
Convert with dev_err() and co from snd_printk(), etc. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Showing 1 changed file with 27 additions and 19 deletions Side-by-side Diff
sound/pci/intel8x0m.c
... | ... | @@ -334,7 +334,8 @@ |
334 | 334 | /* access to some forbidden (non existent) ac97 registers will not |
335 | 335 | * reset the semaphore. So even if you don't get the semaphore, still |
336 | 336 | * continue the access. We don't need the semaphore anyway. */ |
337 | - snd_printk(KERN_ERR "codec_semaphore: semaphore is not ready [0x%x][0x%x]\n", | |
337 | + dev_err(chip->card->dev, | |
338 | + "codec_semaphore: semaphore is not ready [0x%x][0x%x]\n", | |
338 | 339 | igetbyte(chip, ICHREG(ACC_SEMA)), igetdword(chip, ICHREG(GLOB_STA))); |
339 | 340 | iagetword(chip, 0); /* clear semaphore flag */ |
340 | 341 | /* I don't care about the semaphore */ |
... | ... | @@ -349,7 +350,9 @@ |
349 | 350 | |
350 | 351 | if (snd_intel8x0m_codec_semaphore(chip, ac97->num) < 0) { |
351 | 352 | if (! chip->in_ac97_init) |
352 | - snd_printk(KERN_ERR "codec_write %d: semaphore is not ready for register 0x%x\n", ac97->num, reg); | |
353 | + dev_err(chip->card->dev, | |
354 | + "codec_write %d: semaphore is not ready for register 0x%x\n", | |
355 | + ac97->num, reg); | |
353 | 356 | } |
354 | 357 | iaputword(chip, reg + ac97->num * 0x80, val); |
355 | 358 | } |
... | ... | @@ -363,7 +366,9 @@ |
363 | 366 | |
364 | 367 | if (snd_intel8x0m_codec_semaphore(chip, ac97->num) < 0) { |
365 | 368 | if (! chip->in_ac97_init) |
366 | - snd_printk(KERN_ERR "codec_read %d: semaphore is not ready for register 0x%x\n", ac97->num, reg); | |
369 | + dev_err(chip->card->dev, | |
370 | + "codec_read %d: semaphore is not ready for register 0x%x\n", | |
371 | + ac97->num, reg); | |
367 | 372 | res = 0xffff; |
368 | 373 | } else { |
369 | 374 | res = iagetword(chip, reg + ac97->num * 0x80); |
... | ... | @@ -372,7 +377,9 @@ |
372 | 377 | iputdword(chip, ICHREG(GLOB_STA), |
373 | 378 | tmp & ~(ICH_SRI|ICH_PRI|ICH_TRI|ICH_GSCI)); |
374 | 379 | if (! chip->in_ac97_init) |
375 | - snd_printk(KERN_ERR "codec_read %d: read timeout for register 0x%x\n", ac97->num, reg); | |
380 | + dev_err(chip->card->dev, | |
381 | + "codec_read %d: read timeout for register 0x%x\n", | |
382 | + ac97->num, reg); | |
376 | 383 | res = 0xffff; |
377 | 384 | } |
378 | 385 | } |
... | ... | @@ -412,7 +419,7 @@ |
412 | 419 | bdbar[idx + 1] = cpu_to_le32(0x80000000 | /* interrupt on completion */ |
413 | 420 | ichdev->fragsize >> chip->pcm_pos_shift); |
414 | 421 | /* |
415 | - printk(KERN_DEBUG "bdbar[%i] = 0x%x [0x%x]\n", | |
422 | + dev_dbg(chip->card->dev, "bdbar[%i] = 0x%x [0x%x]\n", | |
416 | 423 | idx + 0, bdbar[idx + 0], bdbar[idx + 1]); |
417 | 424 | */ |
418 | 425 | } |
... | ... | @@ -424,8 +431,8 @@ |
424 | 431 | ichdev->lvi_frag = ICH_REG_LVI_MASK % ichdev->frags; |
425 | 432 | ichdev->position = 0; |
426 | 433 | #if 0 |
427 | - printk(KERN_DEBUG "lvi_frag = %i, frags = %i, period_size = 0x%x, " | |
428 | - "period_size1 = 0x%x\n", | |
434 | + dev_dbg(chip->card->dev, | |
435 | + "lvi_frag = %i, frags = %i, period_size = 0x%x, period_size1 = 0x%x\n", | |
429 | 436 | ichdev->lvi_frag, ichdev->frags, ichdev->fragsize, |
430 | 437 | ichdev->fragsize1); |
431 | 438 | #endif |
... | ... | @@ -470,8 +477,8 @@ |
470 | 477 | ichdev->lvi_frag * |
471 | 478 | ichdev->fragsize1); |
472 | 479 | #if 0 |
473 | - printk(KERN_DEBUG "new: bdbar[%i] = 0x%x [0x%x], " | |
474 | - "prefetch = %i, all = 0x%x, 0x%x\n", | |
480 | + dev_dbg(chip->card->dev, | |
481 | + "new: bdbar[%i] = 0x%x [0x%x], prefetch = %i, all = 0x%x, 0x%x\n", | |
475 | 482 | ichdev->lvi * 2, ichdev->bdbar[ichdev->lvi * 2], |
476 | 483 | ichdev->bdbar[ichdev->lvi * 2 + 1], inb(ICH_REG_OFF_PIV + port), |
477 | 484 | inl(port + 4), inb(port + ICH_REG_OFF_CR)); |
... | ... | @@ -850,7 +857,8 @@ |
850 | 857 | ac97.pci = chip->pci; |
851 | 858 | ac97.num = glob_sta & ICH_SCR ? 1 : 0; |
852 | 859 | if ((err = snd_ac97_mixer(pbus, &ac97, &x97)) < 0) { |
853 | - snd_printk(KERN_ERR "Unable to initialize codec #%d\n", ac97.num); | |
860 | + dev_err(chip->card->dev, | |
861 | + "Unable to initialize codec #%d\n", ac97.num); | |
854 | 862 | if (ac97.num == 0) |
855 | 863 | goto __err; |
856 | 864 | return err; |
... | ... | @@ -901,7 +909,7 @@ |
901 | 909 | goto __ok; |
902 | 910 | schedule_timeout_uninterruptible(1); |
903 | 911 | } while (time_after_eq(end_time, jiffies)); |
904 | - snd_printk(KERN_ERR "AC'97 warm reset still in progress? [0x%x]\n", | |
912 | + dev_err(chip->card->dev, "AC'97 warm reset still in progress? [0x%x]\n", | |
905 | 913 | igetdword(chip, ICHREG(GLOB_CNT))); |
906 | 914 | return -EIO; |
907 | 915 | |
... | ... | @@ -921,7 +929,8 @@ |
921 | 929 | } while (time_after_eq(end_time, jiffies)); |
922 | 930 | if (! status) { |
923 | 931 | /* no codec is found */ |
924 | - snd_printk(KERN_ERR "codec_ready: codec is not ready [0x%x]\n", | |
932 | + dev_err(chip->card->dev, | |
933 | + "codec_ready: codec is not ready [0x%x]\n", | |
925 | 934 | igetdword(chip, ICHREG(GLOB_STA))); |
926 | 935 | return -EIO; |
927 | 936 | } |
928 | 937 | |
... | ... | @@ -1042,16 +1051,15 @@ |
1042 | 1051 | pci_set_power_state(pci, PCI_D0); |
1043 | 1052 | pci_restore_state(pci); |
1044 | 1053 | if (pci_enable_device(pci) < 0) { |
1045 | - printk(KERN_ERR "intel8x0m: pci_enable_device failed, " | |
1046 | - "disabling device\n"); | |
1054 | + dev_err(dev, "pci_enable_device failed, disabling device\n"); | |
1047 | 1055 | snd_card_disconnect(card); |
1048 | 1056 | return -EIO; |
1049 | 1057 | } |
1050 | 1058 | pci_set_master(pci); |
1051 | 1059 | if (request_irq(pci->irq, snd_intel8x0m_interrupt, |
1052 | 1060 | IRQF_SHARED, KBUILD_MODNAME, chip)) { |
1053 | - printk(KERN_ERR "intel8x0m: unable to grab IRQ %d, " | |
1054 | - "disabling device\n", pci->irq); | |
1061 | + dev_err(dev, "unable to grab IRQ %d, disabling device\n", | |
1062 | + pci->irq); | |
1055 | 1063 | snd_card_disconnect(card); |
1056 | 1064 | return -EIO; |
1057 | 1065 | } |
... | ... | @@ -1165,7 +1173,7 @@ |
1165 | 1173 | else |
1166 | 1174 | chip->addr = pci_iomap(pci, 0, 0); |
1167 | 1175 | if (!chip->addr) { |
1168 | - snd_printk(KERN_ERR "AC'97 space ioremap problem\n"); | |
1176 | + dev_err(card->dev, "AC'97 space ioremap problem\n"); | |
1169 | 1177 | snd_intel8x0m_free(chip); |
1170 | 1178 | return -EIO; |
1171 | 1179 | } |
... | ... | @@ -1174,7 +1182,7 @@ |
1174 | 1182 | else |
1175 | 1183 | chip->bmaddr = pci_iomap(pci, 1, 0); |
1176 | 1184 | if (!chip->bmaddr) { |
1177 | - snd_printk(KERN_ERR "Controller space ioremap problem\n"); | |
1185 | + dev_err(card->dev, "Controller space ioremap problem\n"); | |
1178 | 1186 | snd_intel8x0m_free(chip); |
1179 | 1187 | return -EIO; |
1180 | 1188 | } |
... | ... | @@ -1182,7 +1190,7 @@ |
1182 | 1190 | port_inited: |
1183 | 1191 | if (request_irq(pci->irq, snd_intel8x0m_interrupt, IRQF_SHARED, |
1184 | 1192 | KBUILD_MODNAME, chip)) { |
1185 | - snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq); | |
1193 | + dev_err(card->dev, "unable to grab IRQ %d\n", pci->irq); | |
1186 | 1194 | snd_intel8x0m_free(chip); |
1187 | 1195 | return -EBUSY; |
1188 | 1196 | } |