diff options
author | Takashi Iwai <tiwai@suse.de> | 2014-02-25 08:40:45 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-02-26 10:45:19 -0500 |
commit | 813bdba37560e13448b09514feadcf063f914b97 (patch) | |
tree | 06b51390a65d2720bfaf36e0040809f831015b94 /sound/pci/intel8x0m.c | |
parent | f493e7bcaa313870c2b3b94dfae3e5cb5a863565 (diff) |
ALSA: intel8x0m: Use standard printk helpers
Convert with dev_err() and co from snd_printk(), etc.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/intel8x0m.c')
-rw-r--r-- | sound/pci/intel8x0m.c | 46 |
1 files changed, 27 insertions, 19 deletions
diff --git a/sound/pci/intel8x0m.c b/sound/pci/intel8x0m.c index f8c72bd8a3cd..b54d3e93cab1 100644 --- a/sound/pci/intel8x0m.c +++ b/sound/pci/intel8x0m.c | |||
@@ -334,7 +334,8 @@ static int snd_intel8x0m_codec_semaphore(struct intel8x0m *chip, unsigned int co | |||
334 | /* access to some forbidden (non existent) ac97 registers will not | 334 | /* access to some forbidden (non existent) ac97 registers will not |
335 | * reset the semaphore. So even if you don't get the semaphore, still | 335 | * reset the semaphore. So even if you don't get the semaphore, still |
336 | * continue the access. We don't need the semaphore anyway. */ | 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 | igetbyte(chip, ICHREG(ACC_SEMA)), igetdword(chip, ICHREG(GLOB_STA))); | 339 | igetbyte(chip, ICHREG(ACC_SEMA)), igetdword(chip, ICHREG(GLOB_STA))); |
339 | iagetword(chip, 0); /* clear semaphore flag */ | 340 | iagetword(chip, 0); /* clear semaphore flag */ |
340 | /* I don't care about the semaphore */ | 341 | /* I don't care about the semaphore */ |
@@ -349,7 +350,9 @@ static void snd_intel8x0m_codec_write(struct snd_ac97 *ac97, | |||
349 | 350 | ||
350 | if (snd_intel8x0m_codec_semaphore(chip, ac97->num) < 0) { | 351 | if (snd_intel8x0m_codec_semaphore(chip, ac97->num) < 0) { |
351 | if (! chip->in_ac97_init) | 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 | iaputword(chip, reg + ac97->num * 0x80, val); | 357 | iaputword(chip, reg + ac97->num * 0x80, val); |
355 | } | 358 | } |
@@ -363,7 +366,9 @@ static unsigned short snd_intel8x0m_codec_read(struct snd_ac97 *ac97, | |||
363 | 366 | ||
364 | if (snd_intel8x0m_codec_semaphore(chip, ac97->num) < 0) { | 367 | if (snd_intel8x0m_codec_semaphore(chip, ac97->num) < 0) { |
365 | if (! chip->in_ac97_init) | 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 | res = 0xffff; | 372 | res = 0xffff; |
368 | } else { | 373 | } else { |
369 | res = iagetword(chip, reg + ac97->num * 0x80); | 374 | res = iagetword(chip, reg + ac97->num * 0x80); |
@@ -372,7 +377,9 @@ static unsigned short snd_intel8x0m_codec_read(struct snd_ac97 *ac97, | |||
372 | iputdword(chip, ICHREG(GLOB_STA), | 377 | iputdword(chip, ICHREG(GLOB_STA), |
373 | tmp & ~(ICH_SRI|ICH_PRI|ICH_TRI|ICH_GSCI)); | 378 | tmp & ~(ICH_SRI|ICH_PRI|ICH_TRI|ICH_GSCI)); |
374 | if (! chip->in_ac97_init) | 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 | res = 0xffff; | 383 | res = 0xffff; |
377 | } | 384 | } |
378 | } | 385 | } |
@@ -412,7 +419,7 @@ static void snd_intel8x0m_setup_periods(struct intel8x0m *chip, struct ichdev *i | |||
412 | bdbar[idx + 1] = cpu_to_le32(0x80000000 | /* interrupt on completion */ | 419 | bdbar[idx + 1] = cpu_to_le32(0x80000000 | /* interrupt on completion */ |
413 | ichdev->fragsize >> chip->pcm_pos_shift); | 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 | idx + 0, bdbar[idx + 0], bdbar[idx + 1]); | 423 | idx + 0, bdbar[idx + 0], bdbar[idx + 1]); |
417 | */ | 424 | */ |
418 | } | 425 | } |
@@ -424,8 +431,8 @@ static void snd_intel8x0m_setup_periods(struct intel8x0m *chip, struct ichdev *i | |||
424 | ichdev->lvi_frag = ICH_REG_LVI_MASK % ichdev->frags; | 431 | ichdev->lvi_frag = ICH_REG_LVI_MASK % ichdev->frags; |
425 | ichdev->position = 0; | 432 | ichdev->position = 0; |
426 | #if 0 | 433 | #if 0 |
427 | printk(KERN_DEBUG "lvi_frag = %i, frags = %i, period_size = 0x%x, " | 434 | dev_dbg(chip->card->dev, |
428 | "period_size1 = 0x%x\n", | 435 | "lvi_frag = %i, frags = %i, period_size = 0x%x, period_size1 = 0x%x\n", |
429 | ichdev->lvi_frag, ichdev->frags, ichdev->fragsize, | 436 | ichdev->lvi_frag, ichdev->frags, ichdev->fragsize, |
430 | ichdev->fragsize1); | 437 | ichdev->fragsize1); |
431 | #endif | 438 | #endif |
@@ -470,8 +477,8 @@ static inline void snd_intel8x0m_update(struct intel8x0m *chip, struct ichdev *i | |||
470 | ichdev->lvi_frag * | 477 | ichdev->lvi_frag * |
471 | ichdev->fragsize1); | 478 | ichdev->fragsize1); |
472 | #if 0 | 479 | #if 0 |
473 | printk(KERN_DEBUG "new: bdbar[%i] = 0x%x [0x%x], " | 480 | dev_dbg(chip->card->dev, |
474 | "prefetch = %i, all = 0x%x, 0x%x\n", | 481 | "new: bdbar[%i] = 0x%x [0x%x], prefetch = %i, all = 0x%x, 0x%x\n", |
475 | ichdev->lvi * 2, ichdev->bdbar[ichdev->lvi * 2], | 482 | ichdev->lvi * 2, ichdev->bdbar[ichdev->lvi * 2], |
476 | ichdev->bdbar[ichdev->lvi * 2 + 1], inb(ICH_REG_OFF_PIV + port), | 483 | ichdev->bdbar[ichdev->lvi * 2 + 1], inb(ICH_REG_OFF_PIV + port), |
477 | inl(port + 4), inb(port + ICH_REG_OFF_CR)); | 484 | inl(port + 4), inb(port + ICH_REG_OFF_CR)); |
@@ -850,7 +857,8 @@ static int snd_intel8x0m_mixer(struct intel8x0m *chip, int ac97_clock) | |||
850 | ac97.pci = chip->pci; | 857 | ac97.pci = chip->pci; |
851 | ac97.num = glob_sta & ICH_SCR ? 1 : 0; | 858 | ac97.num = glob_sta & ICH_SCR ? 1 : 0; |
852 | if ((err = snd_ac97_mixer(pbus, &ac97, &x97)) < 0) { | 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 | if (ac97.num == 0) | 862 | if (ac97.num == 0) |
855 | goto __err; | 863 | goto __err; |
856 | return err; | 864 | return err; |
@@ -901,7 +909,7 @@ static int snd_intel8x0m_ich_chip_init(struct intel8x0m *chip, int probing) | |||
901 | goto __ok; | 909 | goto __ok; |
902 | schedule_timeout_uninterruptible(1); | 910 | schedule_timeout_uninterruptible(1); |
903 | } while (time_after_eq(end_time, jiffies)); | 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 | igetdword(chip, ICHREG(GLOB_CNT))); | 913 | igetdword(chip, ICHREG(GLOB_CNT))); |
906 | return -EIO; | 914 | return -EIO; |
907 | 915 | ||
@@ -921,7 +929,8 @@ static int snd_intel8x0m_ich_chip_init(struct intel8x0m *chip, int probing) | |||
921 | } while (time_after_eq(end_time, jiffies)); | 929 | } while (time_after_eq(end_time, jiffies)); |
922 | if (! status) { | 930 | if (! status) { |
923 | /* no codec is found */ | 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 | igetdword(chip, ICHREG(GLOB_STA))); | 934 | igetdword(chip, ICHREG(GLOB_STA))); |
926 | return -EIO; | 935 | return -EIO; |
927 | } | 936 | } |
@@ -1042,16 +1051,15 @@ static int intel8x0m_resume(struct device *dev) | |||
1042 | pci_set_power_state(pci, PCI_D0); | 1051 | pci_set_power_state(pci, PCI_D0); |
1043 | pci_restore_state(pci); | 1052 | pci_restore_state(pci); |
1044 | if (pci_enable_device(pci) < 0) { | 1053 | if (pci_enable_device(pci) < 0) { |
1045 | printk(KERN_ERR "intel8x0m: pci_enable_device failed, " | 1054 | dev_err(dev, "pci_enable_device failed, disabling device\n"); |
1046 | "disabling device\n"); | ||
1047 | snd_card_disconnect(card); | 1055 | snd_card_disconnect(card); |
1048 | return -EIO; | 1056 | return -EIO; |
1049 | } | 1057 | } |
1050 | pci_set_master(pci); | 1058 | pci_set_master(pci); |
1051 | if (request_irq(pci->irq, snd_intel8x0m_interrupt, | 1059 | if (request_irq(pci->irq, snd_intel8x0m_interrupt, |
1052 | IRQF_SHARED, KBUILD_MODNAME, chip)) { | 1060 | IRQF_SHARED, KBUILD_MODNAME, chip)) { |
1053 | printk(KERN_ERR "intel8x0m: unable to grab IRQ %d, " | 1061 | dev_err(dev, "unable to grab IRQ %d, disabling device\n", |
1054 | "disabling device\n", pci->irq); | 1062 | pci->irq); |
1055 | snd_card_disconnect(card); | 1063 | snd_card_disconnect(card); |
1056 | return -EIO; | 1064 | return -EIO; |
1057 | } | 1065 | } |
@@ -1165,7 +1173,7 @@ static int snd_intel8x0m_create(struct snd_card *card, | |||
1165 | else | 1173 | else |
1166 | chip->addr = pci_iomap(pci, 0, 0); | 1174 | chip->addr = pci_iomap(pci, 0, 0); |
1167 | if (!chip->addr) { | 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 | snd_intel8x0m_free(chip); | 1177 | snd_intel8x0m_free(chip); |
1170 | return -EIO; | 1178 | return -EIO; |
1171 | } | 1179 | } |
@@ -1174,7 +1182,7 @@ static int snd_intel8x0m_create(struct snd_card *card, | |||
1174 | else | 1182 | else |
1175 | chip->bmaddr = pci_iomap(pci, 1, 0); | 1183 | chip->bmaddr = pci_iomap(pci, 1, 0); |
1176 | if (!chip->bmaddr) { | 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 | snd_intel8x0m_free(chip); | 1186 | snd_intel8x0m_free(chip); |
1179 | return -EIO; | 1187 | return -EIO; |
1180 | } | 1188 | } |
@@ -1182,7 +1190,7 @@ static int snd_intel8x0m_create(struct snd_card *card, | |||
1182 | port_inited: | 1190 | port_inited: |
1183 | if (request_irq(pci->irq, snd_intel8x0m_interrupt, IRQF_SHARED, | 1191 | if (request_irq(pci->irq, snd_intel8x0m_interrupt, IRQF_SHARED, |
1184 | KBUILD_MODNAME, chip)) { | 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 | snd_intel8x0m_free(chip); | 1194 | snd_intel8x0m_free(chip); |
1187 | return -EBUSY; | 1195 | return -EBUSY; |
1188 | } | 1196 | } |