Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: ymfpci: Use standard printk helpers

Convert with dev_err() and co from snd_printk(), etc.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

+30 -18
+15 -7
sound/pci/ymfpci/ymfpci.c
··· 106 106 break; 107 107 } 108 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 111 return -EBUSY; 111 112 } 112 113 } ··· 117 116 case 0x204: legacy_ctrl2 |= 2 << 6; break; 118 117 case 0x205: legacy_ctrl2 |= 3 << 6; break; 119 118 default: 120 - printk(KERN_ERR "ymfpci: invalid joystick port %#x", io_port); 119 + dev_err(chip->card->dev, 120 + "invalid joystick port %#x", io_port); 121 121 return -EINVAL; 122 122 } 123 123 } 124 124 125 125 if (!r && !(r = request_region(io_port, 1, "YMFPCI gameport"))) { 126 - printk(KERN_ERR "ymfpci: joystick port %#x is in use.\n", io_port); 126 + dev_err(chip->card->dev, 127 + "joystick port %#x is in use.\n", io_port); 127 128 return -EBUSY; 128 129 } 129 130 130 131 chip->gameport = gp = gameport_allocate_port(); 131 132 if (!gp) { 132 - printk(KERN_ERR "ymfpci: cannot allocate memory for gameport\n"); 133 + dev_err(chip->card->dev, 134 + "cannot allocate memory for gameport\n"); 133 135 release_and_free_resource(r); 134 136 return -ENOMEM; 135 137 } ··· 318 314 MPU401_INFO_INTEGRATED | 319 315 MPU401_INFO_IRQ_HOOK, 320 316 -1, &chip->rawmidi)) < 0) { 321 - printk(KERN_WARNING "ymfpci: cannot initialize MPU401 at 0x%lx, skipping...\n", mpu_port[dev]); 317 + dev_warn(card->dev, 318 + "cannot initialize MPU401 at 0x%lx, skipping...\n", 319 + mpu_port[dev]); 322 320 legacy_ctrl &= ~YMFPCI_LEGACY_MIEN; /* disable MPU401 irq */ 323 321 pci_write_config_word(pci, PCIR_DSXG_LEGACY, legacy_ctrl); 324 322 } ··· 330 324 fm_port[dev], 331 325 fm_port[dev] + 2, 332 326 OPL3_HW_OPL3, 1, &opl3)) < 0) { 333 - printk(KERN_WARNING "ymfpci: cannot initialize FM OPL3 at 0x%lx, skipping...\n", fm_port[dev]); 327 + dev_warn(card->dev, 328 + "cannot initialize FM OPL3 at 0x%lx, skipping...\n", 329 + fm_port[dev]); 334 330 legacy_ctrl &= ~YMFPCI_LEGACY_FMEN; 335 331 pci_write_config_word(pci, PCIR_DSXG_LEGACY, legacy_ctrl); 336 332 } else if ((err = snd_opl3_hwdep_new(opl3, 0, 1, NULL)) < 0) { 337 333 snd_card_free(card); 338 - snd_printk(KERN_ERR "cannot create opl3 hwdep\n"); 334 + dev_err(card->dev, "cannot create opl3 hwdep\n"); 339 335 return err; 340 336 } 341 337 }
+15 -11
sound/pci/ymfpci/ymfpci_main.c
··· 86 86 return 0; 87 87 schedule_timeout_uninterruptible(1); 88 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 92 return -EBUSY; 91 93 } 92 94 ··· 321 319 ypcm->last_pos = pos; 322 320 if (ypcm->period_pos >= ypcm->period_size) { 323 321 /* 324 - printk(KERN_DEBUG 322 + dev_dbg(chip->card->dev, 325 323 "done - active_bank = 0x%x, start = 0x%x\n", 326 324 chip->active_bank, 327 325 voice->bank[chip->active_bank].start); ··· 374 372 if (ypcm->period_pos >= ypcm->period_size) { 375 373 ypcm->period_pos %= ypcm->period_size; 376 374 /* 377 - printk(KERN_DEBUG 375 + dev_dbg(chip->card->dev, 378 376 "done - active_bank = 0x%x, start = 0x%x\n", 379 377 chip->active_bank, 380 378 voice->bank[chip->active_bank].start); ··· 2069 2067 &chip->pci->dev); 2070 2068 if (err >= 0) { 2071 2069 if (chip->dsp_microcode->size != YDSXG_DSPLENGTH) { 2072 - snd_printk(KERN_ERR "DSP microcode has wrong size\n"); 2070 + dev_err(chip->card->dev, 2071 + "DSP microcode has wrong size\n"); 2073 2072 err = -EINVAL; 2074 2073 } 2075 2074 } ··· 2085 2082 &chip->pci->dev); 2086 2083 if (err >= 0) { 2087 2084 if (chip->controller_microcode->size != YDSXG_CTRLLENGTH) { 2088 - snd_printk(KERN_ERR "controller microcode" 2089 - " has wrong size\n"); 2085 + dev_err(chip->card->dev, 2086 + "controller microcode has wrong size\n"); 2090 2087 err = -EINVAL; 2091 2088 } 2092 2089 } ··· 2363 2360 pci_set_power_state(pci, PCI_D0); 2364 2361 pci_restore_state(pci); 2365 2362 if (pci_enable_device(pci) < 0) { 2366 - printk(KERN_ERR "ymfpci: pci_enable_device failed, " 2367 - "disabling device\n"); 2363 + dev_err(dev, "pci_enable_device failed, disabling device\n"); 2368 2364 snd_card_disconnect(card); 2369 2365 return -EIO; 2370 2366 } ··· 2435 2433 chip->src441_used = -1; 2436 2434 2437 2435 if ((chip->res_reg_area = request_mem_region(chip->reg_area_phys, 0x8000, "YMFPCI")) == NULL) { 2438 - snd_printk(KERN_ERR "unable to grab memory region 0x%lx-0x%lx\n", chip->reg_area_phys, chip->reg_area_phys + 0x8000 - 1); 2436 + dev_err(chip->card->dev, 2437 + "unable to grab memory region 0x%lx-0x%lx\n", 2438 + chip->reg_area_phys, chip->reg_area_phys + 0x8000 - 1); 2439 2439 snd_ymfpci_free(chip); 2440 2440 return -EBUSY; 2441 2441 } 2442 2442 if (request_irq(pci->irq, snd_ymfpci_interrupt, IRQF_SHARED, 2443 2443 KBUILD_MODNAME, chip)) { 2444 - snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq); 2444 + dev_err(chip->card->dev, "unable to grab IRQ %d\n", pci->irq); 2445 2445 snd_ymfpci_free(chip); 2446 2446 return -EBUSY; 2447 2447 } ··· 2457 2453 2458 2454 err = snd_ymfpci_request_firmware(chip); 2459 2455 if (err < 0) { 2460 - snd_printk(KERN_ERR "firmware request failed: %d\n", err); 2456 + dev_err(chip->card->dev, "firmware request failed: %d\n", err); 2461 2457 snd_ymfpci_free(chip); 2462 2458 return err; 2463 2459 }