mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 15:18:19 +00:00
ALSA: cs4281: Use standard printk helpers
Convert with dev_err() and co from snd_printk(), etc. Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
40175bdba1
commit
b055e7b483
1 changed files with 27 additions and 17 deletions
|
@ -564,7 +564,8 @@ static void snd_cs4281_ac97_write(struct snd_ac97 *ac97,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
snd_printk(KERN_ERR "AC'97 write problem, reg = 0x%x, val = 0x%x\n", reg, val);
|
dev_err(chip->card->dev,
|
||||||
|
"AC'97 write problem, reg = 0x%x, val = 0x%x\n", reg, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned short snd_cs4281_ac97_read(struct snd_ac97 *ac97,
|
static unsigned short snd_cs4281_ac97_read(struct snd_ac97 *ac97,
|
||||||
|
@ -624,7 +625,8 @@ static unsigned short snd_cs4281_ac97_read(struct snd_ac97 *ac97,
|
||||||
goto __ok1;
|
goto __ok1;
|
||||||
}
|
}
|
||||||
|
|
||||||
snd_printk(KERN_ERR "AC'97 read problem (ACCTL_DCV), reg = 0x%x\n", reg);
|
dev_err(chip->card->dev,
|
||||||
|
"AC'97 read problem (ACCTL_DCV), reg = 0x%x\n", reg);
|
||||||
result = 0xffff;
|
result = 0xffff;
|
||||||
goto __end;
|
goto __end;
|
||||||
|
|
||||||
|
@ -643,7 +645,8 @@ static unsigned short snd_cs4281_ac97_read(struct snd_ac97 *ac97,
|
||||||
udelay(10);
|
udelay(10);
|
||||||
}
|
}
|
||||||
|
|
||||||
snd_printk(KERN_ERR "AC'97 read problem (ACSTS_VSTS), reg = 0x%x\n", reg);
|
dev_err(chip->card->dev,
|
||||||
|
"AC'97 read problem (ACSTS_VSTS), reg = 0x%x\n", reg);
|
||||||
result = 0xffff;
|
result = 0xffff;
|
||||||
goto __end;
|
goto __end;
|
||||||
|
|
||||||
|
@ -835,7 +838,8 @@ static snd_pcm_uframes_t snd_cs4281_pointer(struct snd_pcm_substream *substream)
|
||||||
struct cs4281 *chip = snd_pcm_substream_chip(substream);
|
struct cs4281 *chip = snd_pcm_substream_chip(substream);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
printk(KERN_DEBUG "DCC = 0x%x, buffer_size = 0x%x, jiffies = %li\n",
|
dev_dbg(chip->card->dev,
|
||||||
|
"DCC = 0x%x, buffer_size = 0x%x, jiffies = %li\n",
|
||||||
snd_cs4281_peekBA0(chip, dma->regDCC), runtime->buffer_size,
|
snd_cs4281_peekBA0(chip, dma->regDCC), runtime->buffer_size,
|
||||||
jiffies);
|
jiffies);
|
||||||
*/
|
*/
|
||||||
|
@ -1265,7 +1269,8 @@ static int snd_cs4281_create_gameport(struct cs4281 *chip)
|
||||||
|
|
||||||
chip->gameport = gp = gameport_allocate_port();
|
chip->gameport = gp = gameport_allocate_port();
|
||||||
if (!gp) {
|
if (!gp) {
|
||||||
printk(KERN_ERR "cs4281: cannot allocate memory for gameport\n");
|
dev_err(chip->card->dev,
|
||||||
|
"cannot allocate memory for gameport\n");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1361,7 +1366,7 @@ static int snd_cs4281_create(struct snd_card *card,
|
||||||
chip->irq = -1;
|
chip->irq = -1;
|
||||||
pci_set_master(pci);
|
pci_set_master(pci);
|
||||||
if (dual_codec < 0 || dual_codec > 3) {
|
if (dual_codec < 0 || dual_codec > 3) {
|
||||||
snd_printk(KERN_ERR "invalid dual_codec option %d\n", dual_codec);
|
dev_err(card->dev, "invalid dual_codec option %d\n", dual_codec);
|
||||||
dual_codec = 0;
|
dual_codec = 0;
|
||||||
}
|
}
|
||||||
chip->dual_codec = dual_codec;
|
chip->dual_codec = dual_codec;
|
||||||
|
@ -1383,7 +1388,7 @@ static int snd_cs4281_create(struct snd_card *card,
|
||||||
|
|
||||||
if (request_irq(pci->irq, snd_cs4281_interrupt, IRQF_SHARED,
|
if (request_irq(pci->irq, snd_cs4281_interrupt, IRQF_SHARED,
|
||||||
KBUILD_MODNAME, chip)) {
|
KBUILD_MODNAME, chip)) {
|
||||||
snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
|
dev_err(card->dev, "unable to grab IRQ %d\n", pci->irq);
|
||||||
snd_cs4281_free(chip);
|
snd_cs4281_free(chip);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
@ -1423,7 +1428,8 @@ static int snd_cs4281_chip_init(struct cs4281 *chip)
|
||||||
snd_cs4281_pokeBA0(chip, BA0_CFLR, BA0_CFLR_DEFAULT);
|
snd_cs4281_pokeBA0(chip, BA0_CFLR, BA0_CFLR_DEFAULT);
|
||||||
tmp = snd_cs4281_peekBA0(chip, BA0_CFLR);
|
tmp = snd_cs4281_peekBA0(chip, BA0_CFLR);
|
||||||
if (tmp != BA0_CFLR_DEFAULT) {
|
if (tmp != BA0_CFLR_DEFAULT) {
|
||||||
snd_printk(KERN_ERR "CFLR setup failed (0x%x)\n", tmp);
|
dev_err(chip->card->dev,
|
||||||
|
"CFLR setup failed (0x%x)\n", tmp);
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1434,11 +1440,13 @@ static int snd_cs4281_chip_init(struct cs4281 *chip)
|
||||||
snd_cs4281_pokeBA0(chip, BA0_CWPR, 0x4281);
|
snd_cs4281_pokeBA0(chip, BA0_CWPR, 0x4281);
|
||||||
|
|
||||||
if ((tmp = snd_cs4281_peekBA0(chip, BA0_SERC1)) != (BA0_SERC1_SO1EN | BA0_SERC1_AC97)) {
|
if ((tmp = snd_cs4281_peekBA0(chip, BA0_SERC1)) != (BA0_SERC1_SO1EN | BA0_SERC1_AC97)) {
|
||||||
snd_printk(KERN_ERR "SERC1 AC'97 check failed (0x%x)\n", tmp);
|
dev_err(chip->card->dev,
|
||||||
|
"SERC1 AC'97 check failed (0x%x)\n", tmp);
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
if ((tmp = snd_cs4281_peekBA0(chip, BA0_SERC2)) != (BA0_SERC2_SI1EN | BA0_SERC2_AC97)) {
|
if ((tmp = snd_cs4281_peekBA0(chip, BA0_SERC2)) != (BA0_SERC2_SI1EN | BA0_SERC2_AC97)) {
|
||||||
snd_printk(KERN_ERR "SERC2 AC'97 check failed (0x%x)\n", tmp);
|
dev_err(chip->card->dev,
|
||||||
|
"SERC2 AC'97 check failed (0x%x)\n", tmp);
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1500,7 +1508,7 @@ static int snd_cs4281_chip_init(struct cs4281 *chip)
|
||||||
schedule_timeout_uninterruptible(1);
|
schedule_timeout_uninterruptible(1);
|
||||||
} while (time_after_eq(end_time, jiffies));
|
} while (time_after_eq(end_time, jiffies));
|
||||||
|
|
||||||
snd_printk(KERN_ERR "DLLRDY not seen\n");
|
dev_err(chip->card->dev, "DLLRDY not seen\n");
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
|
||||||
__ok0:
|
__ok0:
|
||||||
|
@ -1526,7 +1534,9 @@ static int snd_cs4281_chip_init(struct cs4281 *chip)
|
||||||
schedule_timeout_uninterruptible(1);
|
schedule_timeout_uninterruptible(1);
|
||||||
} while (time_after_eq(end_time, jiffies));
|
} while (time_after_eq(end_time, jiffies));
|
||||||
|
|
||||||
snd_printk(KERN_ERR "never read codec ready from AC'97 (0x%x)\n", snd_cs4281_peekBA0(chip, BA0_ACSTS));
|
dev_err(chip->card->dev,
|
||||||
|
"never read codec ready from AC'97 (0x%x)\n",
|
||||||
|
snd_cs4281_peekBA0(chip, BA0_ACSTS));
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
|
||||||
__ok1:
|
__ok1:
|
||||||
|
@ -1537,7 +1547,8 @@ static int snd_cs4281_chip_init(struct cs4281 *chip)
|
||||||
goto __codec2_ok;
|
goto __codec2_ok;
|
||||||
schedule_timeout_uninterruptible(1);
|
schedule_timeout_uninterruptible(1);
|
||||||
} while (time_after_eq(end_time, jiffies));
|
} while (time_after_eq(end_time, jiffies));
|
||||||
snd_printk(KERN_INFO "secondary codec doesn't respond. disable it...\n");
|
dev_info(chip->card->dev,
|
||||||
|
"secondary codec doesn't respond. disable it...\n");
|
||||||
chip->dual_codec = 0;
|
chip->dual_codec = 0;
|
||||||
__codec2_ok: ;
|
__codec2_ok: ;
|
||||||
}
|
}
|
||||||
|
@ -1567,7 +1578,7 @@ static int snd_cs4281_chip_init(struct cs4281 *chip)
|
||||||
|
|
||||||
if (--retry_count > 0)
|
if (--retry_count > 0)
|
||||||
goto __retry;
|
goto __retry;
|
||||||
snd_printk(KERN_ERR "never read ISV3 and ISV4 from AC'97\n");
|
dev_err(chip->card->dev, "never read ISV3 and ISV4 from AC'97\n");
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
|
||||||
__ok2:
|
__ok2:
|
||||||
|
@ -2054,8 +2065,7 @@ static int cs4281_resume(struct device *dev)
|
||||||
pci_set_power_state(pci, PCI_D0);
|
pci_set_power_state(pci, PCI_D0);
|
||||||
pci_restore_state(pci);
|
pci_restore_state(pci);
|
||||||
if (pci_enable_device(pci) < 0) {
|
if (pci_enable_device(pci) < 0) {
|
||||||
printk(KERN_ERR "cs4281: pci_enable_device failed, "
|
dev_err(dev, "pci_enable_device failed, disabling device\n");
|
||||||
"disabling device\n");
|
|
||||||
snd_card_disconnect(card);
|
snd_card_disconnect(card);
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue