aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-02-26 06:18:27 -0500
committerTakashi Iwai <tiwai@suse.de>2014-02-26 10:45:33 -0500
commit6436bcf6a4a35ae83af9ff3c250435e5fd001205 (patch)
tree80596d7621f295d11733f1e26b7d0cee6b730695 /sound/pci
parent4c826c492f151afb2fef9068660c61c27d191a5a (diff)
ALSA: ymfpci: 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')
-rw-r--r--sound/pci/ymfpci/ymfpci.c22
-rw-r--r--sound/pci/ymfpci/ymfpci_main.c26
2 files changed, 30 insertions, 18 deletions
diff --git a/sound/pci/ymfpci/ymfpci.c b/sound/pci/ymfpci/ymfpci.c
index 6ff4ea389b02..82eed164b275 100644
--- a/sound/pci/ymfpci/ymfpci.c
+++ b/sound/pci/ymfpci/ymfpci.c
@@ -106,7 +106,8 @@ static int snd_ymfpci_create_gameport(struct snd_ymfpci *chip, int dev,
106 break; 106 break;
107 } 107 }
108 if (!r) { 108 if (!r) {
109 printk(KERN_ERR "ymfpci: no gameport ports available\n"); 109 dev_err(chip->card->dev,
110 "no gameport ports available\n");
110 return -EBUSY; 111 return -EBUSY;
111 } 112 }
112 } 113 }
@@ -116,19 +117,22 @@ static int snd_ymfpci_create_gameport(struct snd_ymfpci *chip, int dev,
116 case 0x204: legacy_ctrl2 |= 2 << 6; break; 117 case 0x204: legacy_ctrl2 |= 2 << 6; break;
117 case 0x205: legacy_ctrl2 |= 3 << 6; break; 118 case 0x205: legacy_ctrl2 |= 3 << 6; break;
118 default: 119 default:
119 printk(KERN_ERR "ymfpci: invalid joystick port %#x", io_port); 120 dev_err(chip->card->dev,
121 "invalid joystick port %#x", io_port);
120 return -EINVAL; 122 return -EINVAL;
121 } 123 }
122 } 124 }
123 125
124 if (!r && !(r = request_region(io_port, 1, "YMFPCI gameport"))) { 126 if (!r && !(r = request_region(io_port, 1, "YMFPCI gameport"))) {
125 printk(KERN_ERR "ymfpci: joystick port %#x is in use.\n", io_port); 127 dev_err(chip->card->dev,
128 "joystick port %#x is in use.\n", io_port);
126 return -EBUSY; 129 return -EBUSY;
127 } 130 }
128 131
129 chip->gameport = gp = gameport_allocate_port(); 132 chip->gameport = gp = gameport_allocate_port();
130 if (!gp) { 133 if (!gp) {
131 printk(KERN_ERR "ymfpci: cannot allocate memory for gameport\n"); 134 dev_err(chip->card->dev,
135 "cannot allocate memory for gameport\n");
132 release_and_free_resource(r); 136 release_and_free_resource(r);
133 return -ENOMEM; 137 return -ENOMEM;
134 } 138 }
@@ -314,7 +318,9 @@ static int snd_card_ymfpci_probe(struct pci_dev *pci,
314 MPU401_INFO_INTEGRATED | 318 MPU401_INFO_INTEGRATED |
315 MPU401_INFO_IRQ_HOOK, 319 MPU401_INFO_IRQ_HOOK,
316 -1, &chip->rawmidi)) < 0) { 320 -1, &chip->rawmidi)) < 0) {
317 printk(KERN_WARNING "ymfpci: cannot initialize MPU401 at 0x%lx, skipping...\n", mpu_port[dev]); 321 dev_warn(card->dev,
322 "cannot initialize MPU401 at 0x%lx, skipping...\n",
323 mpu_port[dev]);
318 legacy_ctrl &= ~YMFPCI_LEGACY_MIEN; /* disable MPU401 irq */ 324 legacy_ctrl &= ~YMFPCI_LEGACY_MIEN; /* disable MPU401 irq */
319 pci_write_config_word(pci, PCIR_DSXG_LEGACY, legacy_ctrl); 325 pci_write_config_word(pci, PCIR_DSXG_LEGACY, legacy_ctrl);
320 } 326 }
@@ -324,12 +330,14 @@ static int snd_card_ymfpci_probe(struct pci_dev *pci,
324 fm_port[dev], 330 fm_port[dev],
325 fm_port[dev] + 2, 331 fm_port[dev] + 2,
326 OPL3_HW_OPL3, 1, &opl3)) < 0) { 332 OPL3_HW_OPL3, 1, &opl3)) < 0) {
327 printk(KERN_WARNING "ymfpci: cannot initialize FM OPL3 at 0x%lx, skipping...\n", fm_port[dev]); 333 dev_warn(card->dev,
334 "cannot initialize FM OPL3 at 0x%lx, skipping...\n",
335 fm_port[dev]);
328 legacy_ctrl &= ~YMFPCI_LEGACY_FMEN; 336 legacy_ctrl &= ~YMFPCI_LEGACY_FMEN;
329 pci_write_config_word(pci, PCIR_DSXG_LEGACY, legacy_ctrl); 337 pci_write_config_word(pci, PCIR_DSXG_LEGACY, legacy_ctrl);
330 } else if ((err = snd_opl3_hwdep_new(opl3, 0, 1, NULL)) < 0) { 338 } else if ((err = snd_opl3_hwdep_new(opl3, 0, 1, NULL)) < 0) {
331 snd_card_free(card); 339 snd_card_free(card);
332 snd_printk(KERN_ERR "cannot create opl3 hwdep\n"); 340 dev_err(card->dev, "cannot create opl3 hwdep\n");
333 return err; 341 return err;
334 } 342 }
335 } 343 }
diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c
index c7e98ff4f80f..81c916a5eb96 100644
--- a/sound/pci/ymfpci/ymfpci_main.c
+++ b/sound/pci/ymfpci/ymfpci_main.c
@@ -86,7 +86,9 @@ static int snd_ymfpci_codec_ready(struct snd_ymfpci *chip, int secondary)
86 return 0; 86 return 0;
87 schedule_timeout_uninterruptible(1); 87 schedule_timeout_uninterruptible(1);
88 } while (time_before(jiffies, end_time)); 88 } while (time_before(jiffies, end_time));
89 snd_printk(KERN_ERR "codec_ready: codec %i is not ready [0x%x]\n", secondary, snd_ymfpci_readw(chip, reg)); 89 dev_err(chip->card->dev,
90 "codec_ready: codec %i is not ready [0x%x]\n",
91 secondary, snd_ymfpci_readw(chip, reg));
90 return -EBUSY; 92 return -EBUSY;
91} 93}
92 94
@@ -319,7 +321,7 @@ static void snd_ymfpci_pcm_interrupt(struct snd_ymfpci *chip, struct snd_ymfpci_
319 ypcm->last_pos = pos; 321 ypcm->last_pos = pos;
320 if (ypcm->period_pos >= ypcm->period_size) { 322 if (ypcm->period_pos >= ypcm->period_size) {
321 /* 323 /*
322 printk(KERN_DEBUG 324 dev_dbg(chip->card->dev,
323 "done - active_bank = 0x%x, start = 0x%x\n", 325 "done - active_bank = 0x%x, start = 0x%x\n",
324 chip->active_bank, 326 chip->active_bank,
325 voice->bank[chip->active_bank].start); 327 voice->bank[chip->active_bank].start);
@@ -372,7 +374,7 @@ static void snd_ymfpci_pcm_capture_interrupt(struct snd_pcm_substream *substream
372 if (ypcm->period_pos >= ypcm->period_size) { 374 if (ypcm->period_pos >= ypcm->period_size) {
373 ypcm->period_pos %= ypcm->period_size; 375 ypcm->period_pos %= ypcm->period_size;
374 /* 376 /*
375 printk(KERN_DEBUG 377 dev_dbg(chip->card->dev,
376 "done - active_bank = 0x%x, start = 0x%x\n", 378 "done - active_bank = 0x%x, start = 0x%x\n",
377 chip->active_bank, 379 chip->active_bank,
378 voice->bank[chip->active_bank].start); 380 voice->bank[chip->active_bank].start);
@@ -2067,7 +2069,8 @@ static int snd_ymfpci_request_firmware(struct snd_ymfpci *chip)
2067 &chip->pci->dev); 2069 &chip->pci->dev);
2068 if (err >= 0) { 2070 if (err >= 0) {
2069 if (chip->dsp_microcode->size != YDSXG_DSPLENGTH) { 2071 if (chip->dsp_microcode->size != YDSXG_DSPLENGTH) {
2070 snd_printk(KERN_ERR "DSP microcode has wrong size\n"); 2072 dev_err(chip->card->dev,
2073 "DSP microcode has wrong size\n");
2071 err = -EINVAL; 2074 err = -EINVAL;
2072 } 2075 }
2073 } 2076 }
@@ -2082,8 +2085,8 @@ static int snd_ymfpci_request_firmware(struct snd_ymfpci *chip)
2082 &chip->pci->dev); 2085 &chip->pci->dev);
2083 if (err >= 0) { 2086 if (err >= 0) {
2084 if (chip->controller_microcode->size != YDSXG_CTRLLENGTH) { 2087 if (chip->controller_microcode->size != YDSXG_CTRLLENGTH) {
2085 snd_printk(KERN_ERR "controller microcode" 2088 dev_err(chip->card->dev,
2086 " has wrong size\n"); 2089 "controller microcode has wrong size\n");
2087 err = -EINVAL; 2090 err = -EINVAL;
2088 } 2091 }
2089 } 2092 }
@@ -2360,8 +2363,7 @@ static int snd_ymfpci_resume(struct device *dev)
2360 pci_set_power_state(pci, PCI_D0); 2363 pci_set_power_state(pci, PCI_D0);
2361 pci_restore_state(pci); 2364 pci_restore_state(pci);
2362 if (pci_enable_device(pci) < 0) { 2365 if (pci_enable_device(pci) < 0) {
2363 printk(KERN_ERR "ymfpci: pci_enable_device failed, " 2366 dev_err(dev, "pci_enable_device failed, disabling device\n");
2364 "disabling device\n");
2365 snd_card_disconnect(card); 2367 snd_card_disconnect(card);
2366 return -EIO; 2368 return -EIO;
2367 } 2369 }
@@ -2433,13 +2435,15 @@ int snd_ymfpci_create(struct snd_card *card,
2433 chip->src441_used = -1; 2435 chip->src441_used = -1;
2434 2436
2435 if ((chip->res_reg_area = request_mem_region(chip->reg_area_phys, 0x8000, "YMFPCI")) == NULL) { 2437 if ((chip->res_reg_area = request_mem_region(chip->reg_area_phys, 0x8000, "YMFPCI")) == NULL) {
2436 snd_printk(KERN_ERR "unable to grab memory region 0x%lx-0x%lx\n", chip->reg_area_phys, chip->reg_area_phys + 0x8000 - 1); 2438 dev_err(chip->card->dev,
2439 "unable to grab memory region 0x%lx-0x%lx\n",
2440 chip->reg_area_phys, chip->reg_area_phys + 0x8000 - 1);
2437 snd_ymfpci_free(chip); 2441 snd_ymfpci_free(chip);
2438 return -EBUSY; 2442 return -EBUSY;
2439 } 2443 }
2440 if (request_irq(pci->irq, snd_ymfpci_interrupt, IRQF_SHARED, 2444 if (request_irq(pci->irq, snd_ymfpci_interrupt, IRQF_SHARED,
2441 KBUILD_MODNAME, chip)) { 2445 KBUILD_MODNAME, chip)) {
2442 snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq); 2446 dev_err(chip->card->dev, "unable to grab IRQ %d\n", pci->irq);
2443 snd_ymfpci_free(chip); 2447 snd_ymfpci_free(chip);
2444 return -EBUSY; 2448 return -EBUSY;
2445 } 2449 }
@@ -2453,7 +2457,7 @@ int snd_ymfpci_create(struct snd_card *card,
2453 2457
2454 err = snd_ymfpci_request_firmware(chip); 2458 err = snd_ymfpci_request_firmware(chip);
2455 if (err < 0) { 2459 if (err < 0) {
2456 snd_printk(KERN_ERR "firmware request failed: %d\n", err); 2460 dev_err(chip->card->dev, "firmware request failed: %d\n", err);
2457 snd_ymfpci_free(chip); 2461 snd_ymfpci_free(chip);
2458 return err; 2462 return err;
2459 } 2463 }