From patchwork Wed Feb 26 15:53:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 3726021 X-Patchwork-Delegate: tiwai@suse.de Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0B5C29F35F for ; Wed, 26 Feb 2014 16:28:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1401A201EF for ; Wed, 26 Feb 2014 16:28:30 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id A74BB2018E for ; Wed, 26 Feb 2014 16:28:28 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 9F4B42665DF; Wed, 26 Feb 2014 17:28:25 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id CE64E265965; Wed, 26 Feb 2014 16:55:14 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 161242657CD; Wed, 26 Feb 2014 16:55:02 +0100 (CET) Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 6B16C2657E9 for ; Wed, 26 Feb 2014 16:53:54 +0100 (CET) Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 08DDD75028 for ; Wed, 26 Feb 2014 15:53:54 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Wed, 26 Feb 2014 16:53:48 +0100 Message-Id: <1393430030-26704-47-git-send-email-tiwai@suse.de> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1393430030-26704-1-git-send-email-tiwai@suse.de> References: <1393430030-26704-1-git-send-email-tiwai@suse.de> Subject: [alsa-devel] [PATCH 46/48] ALSA: ymfpci: Use standard printk helpers X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Convert with dev_err() and co from snd_printk(), etc. Signed-off-by: Takashi Iwai --- sound/pci/ymfpci/ymfpci.c | 22 +++++++++++++++------- sound/pci/ymfpci/ymfpci_main.c | 26 +++++++++++++++----------- 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, break; } if (!r) { - printk(KERN_ERR "ymfpci: no gameport ports available\n"); + dev_err(chip->card->dev, + "no gameport ports available\n"); return -EBUSY; } } @@ -116,19 +117,22 @@ static int snd_ymfpci_create_gameport(struct snd_ymfpci *chip, int dev, 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; } @@ -314,7 +318,9 @@ static int snd_card_ymfpci_probe(struct pci_dev *pci, 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); } @@ -324,12 +330,14 @@ static int snd_card_ymfpci_probe(struct pci_dev *pci, 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; } } 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) 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; } @@ -319,7 +321,7 @@ static void snd_ymfpci_pcm_interrupt(struct snd_ymfpci *chip, struct snd_ymfpci_ 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); @@ -372,7 +374,7 @@ static void snd_ymfpci_pcm_capture_interrupt(struct snd_pcm_substream *substream 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); @@ -2067,7 +2069,8 @@ static int snd_ymfpci_request_firmware(struct snd_ymfpci *chip) &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; } } @@ -2082,8 +2085,8 @@ static int snd_ymfpci_request_firmware(struct snd_ymfpci *chip) &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; } } @@ -2360,8 +2363,7 @@ static int snd_ymfpci_resume(struct device *dev) 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; } @@ -2433,13 +2435,15 @@ int snd_ymfpci_create(struct snd_card *card, 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; } @@ -2453,7 +2457,7 @@ int snd_ymfpci_create(struct snd_card *card, 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; }