break;
}
if (!r) {
- printk(KERN_ERR "ymfpci: no gameport ports available\n");
+ dev_err(chip->card->dev,
+ "no gameport ports available\n");
return -EBUSY;
}
}
case 0x204: legacy_ctrl2 |= 2 << 6; break;
case 0x205: legacy_ctrl2 |= 3 << 6; break;
default:
- printk(KERN_ERR "ymfpci: invalid joystick port %#x", io_port);
+ dev_err(chip->card->dev,
+ "invalid joystick port %#x", io_port);
return -EINVAL;
}
}
if (!r && !(r = request_region(io_port, 1, "YMFPCI gameport"))) {
- printk(KERN_ERR "ymfpci: joystick port %#x is in use.\n", io_port);
+ dev_err(chip->card->dev,
+ "joystick port %#x is in use.\n", io_port);
return -EBUSY;
}
chip->gameport = gp = gameport_allocate_port();
if (!gp) {
- printk(KERN_ERR "ymfpci: cannot allocate memory for gameport\n");
+ dev_err(chip->card->dev,
+ "cannot allocate memory for gameport\n");
release_and_free_resource(r);
return -ENOMEM;
}
MPU401_INFO_INTEGRATED |
MPU401_INFO_IRQ_HOOK,
-1, &chip->rawmidi)) < 0) {
- printk(KERN_WARNING "ymfpci: cannot initialize MPU401 at 0x%lx, skipping...\n", mpu_port[dev]);
+ dev_warn(card->dev,
+ "cannot initialize MPU401 at 0x%lx, skipping...\n",
+ mpu_port[dev]);
legacy_ctrl &= ~YMFPCI_LEGACY_MIEN; /* disable MPU401 irq */
pci_write_config_word(pci, PCIR_DSXG_LEGACY, legacy_ctrl);
}
fm_port[dev],
fm_port[dev] + 2,
OPL3_HW_OPL3, 1, &opl3)) < 0) {
- printk(KERN_WARNING "ymfpci: cannot initialize FM OPL3 at 0x%lx, skipping...\n", fm_port[dev]);
+ dev_warn(card->dev,
+ "cannot initialize FM OPL3 at 0x%lx, skipping...\n",
+ fm_port[dev]);
legacy_ctrl &= ~YMFPCI_LEGACY_FMEN;
pci_write_config_word(pci, PCIR_DSXG_LEGACY, legacy_ctrl);
} else if ((err = snd_opl3_hwdep_new(opl3, 0, 1, NULL)) < 0) {
snd_card_free(card);
- snd_printk(KERN_ERR "cannot create opl3 hwdep\n");
+ dev_err(card->dev, "cannot create opl3 hwdep\n");
return err;
}
}
return 0;
schedule_timeout_uninterruptible(1);
} while (time_before(jiffies, end_time));
- snd_printk(KERN_ERR "codec_ready: codec %i is not ready [0x%x]\n", secondary, snd_ymfpci_readw(chip, reg));
+ dev_err(chip->card->dev,
+ "codec_ready: codec %i is not ready [0x%x]\n",
+ secondary, snd_ymfpci_readw(chip, reg));
return -EBUSY;
}
ypcm->last_pos = pos;
if (ypcm->period_pos >= ypcm->period_size) {
/*
- printk(KERN_DEBUG
+ dev_dbg(chip->card->dev,
"done - active_bank = 0x%x, start = 0x%x\n",
chip->active_bank,
voice->bank[chip->active_bank].start);
if (ypcm->period_pos >= ypcm->period_size) {
ypcm->period_pos %= ypcm->period_size;
/*
- printk(KERN_DEBUG
+ dev_dbg(chip->card->dev,
"done - active_bank = 0x%x, start = 0x%x\n",
chip->active_bank,
voice->bank[chip->active_bank].start);
&chip->pci->dev);
if (err >= 0) {
if (chip->dsp_microcode->size != YDSXG_DSPLENGTH) {
- snd_printk(KERN_ERR "DSP microcode has wrong size\n");
+ dev_err(chip->card->dev,
+ "DSP microcode has wrong size\n");
err = -EINVAL;
}
}
&chip->pci->dev);
if (err >= 0) {
if (chip->controller_microcode->size != YDSXG_CTRLLENGTH) {
- snd_printk(KERN_ERR "controller microcode"
- " has wrong size\n");
+ dev_err(chip->card->dev,
+ "controller microcode has wrong size\n");
err = -EINVAL;
}
}
pci_set_power_state(pci, PCI_D0);
pci_restore_state(pci);
if (pci_enable_device(pci) < 0) {
- printk(KERN_ERR "ymfpci: pci_enable_device failed, "
- "disabling device\n");
+ dev_err(dev, "pci_enable_device failed, disabling device\n");
snd_card_disconnect(card);
return -EIO;
}
chip->src441_used = -1;
if ((chip->res_reg_area = request_mem_region(chip->reg_area_phys, 0x8000, "YMFPCI")) == NULL) {
- snd_printk(KERN_ERR "unable to grab memory region 0x%lx-0x%lx\n", chip->reg_area_phys, chip->reg_area_phys + 0x8000 - 1);
+ dev_err(chip->card->dev,
+ "unable to grab memory region 0x%lx-0x%lx\n",
+ chip->reg_area_phys, chip->reg_area_phys + 0x8000 - 1);
snd_ymfpci_free(chip);
return -EBUSY;
}
if (request_irq(pci->irq, snd_ymfpci_interrupt, IRQF_SHARED,
KBUILD_MODNAME, chip)) {
- snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
+ dev_err(chip->card->dev, "unable to grab IRQ %d\n", pci->irq);
snd_ymfpci_free(chip);
return -EBUSY;
}
err = snd_ymfpci_request_firmware(chip);
if (err < 0) {
- snd_printk(KERN_ERR "firmware request failed: %d\n", err);
+ dev_err(chip->card->dev, "firmware request failed: %d\n", err);
snd_ymfpci_free(chip);
return err;
}