All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: alsa-devel@alsa-project.org
Subject: [PATCH 01/48] ALSA: ad1889: Use standard printk helpers
Date: Wed, 26 Feb 2014 16:53:03 +0100	[thread overview]
Message-ID: <1393430030-26704-2-git-send-email-tiwai@suse.de> (raw)
In-Reply-To: <1393430030-26704-1-git-send-email-tiwai@suse.de>

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

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/pci/ad1889.c | 32 +++++++++++++++-----------------
 1 file changed, 15 insertions(+), 17 deletions(-)

diff --git a/sound/pci/ad1889.c b/sound/pci/ad1889.c
index ba4da1ed0444..488f966adde3 100644
--- a/sound/pci/ad1889.c
+++ b/sound/pci/ad1889.c
@@ -77,9 +77,6 @@ MODULE_PARM_DESC(ac97_quirk, "AC'97 workaround for strange hardware.");
 #define DEVNAME "ad1889"
 #define PFX	DEVNAME ": "
 
-/* let's use the global sound debug interfaces */
-#define ad1889_debug(fmt, arg...) snd_printd(KERN_DEBUG fmt, ## arg)
-
 /* keep track of some hw registers */
 struct ad1889_register_state {
 	u16 reg;	/* reg setup */
@@ -264,11 +261,11 @@ snd_ad1889_ac97_ready(struct snd_ad1889 *chip)
 			&& --retry)
 		mdelay(1);
 	if (!retry) {
-		snd_printk(KERN_ERR PFX "[%s] Link is not ready.\n",
-		       __func__);
+		dev_err(chip->card->dev, "[%s] Link is not ready.\n",
+			__func__);
 		return -EIO;
 	}
-	ad1889_debug("[%s] ready after %d ms\n", __func__, 400 - retry);
+	dev_dbg(chip->card->dev, "[%s] ready after %d ms\n", __func__, 400 - retry);
 
 	return 0;
 }
@@ -405,9 +402,9 @@ snd_ad1889_playback_prepare(struct snd_pcm_substream *ss)
 	
 	spin_unlock_irq(&chip->lock);
 	
-	ad1889_debug("prepare playback: addr = 0x%x, count = %u, "
-			"size = %u, reg = 0x%x, rate = %u\n", chip->wave.addr,
-			count, size, reg, rt->rate);
+	dev_dbg(chip->card->dev,
+		"prepare playback: addr = 0x%x, count = %u, size = %u, reg = 0x%x, rate = %u\n",
+		chip->wave.addr, count, size, reg, rt->rate);
 	return 0;
 }
 
@@ -452,9 +449,9 @@ snd_ad1889_capture_prepare(struct snd_pcm_substream *ss)
 	
 	spin_unlock_irq(&chip->lock);
 	
-	ad1889_debug("prepare capture: addr = 0x%x, count = %u, "
-			"size = %u, reg = 0x%x, rate = %u\n", chip->ramc.addr,
-			count, size, reg, rt->rate);
+	dev_dbg(chip->card->dev,
+		"prepare capture: addr = 0x%x, count = %u, size = %u, reg = 0x%x, rate = %u\n",
+		chip->ramc.addr, count, size, reg, rt->rate);
 	return 0;
 }
 
@@ -614,7 +611,8 @@ snd_ad1889_interrupt(int irq, void *dev_id)
 		return IRQ_NONE;
 
 	if (st & (AD_DMA_DISR_PMAI|AD_DMA_DISR_PTAI))
-		ad1889_debug("Unexpected master or target abort interrupt!\n");
+		dev_dbg(chip->card->dev,
+			"Unexpected master or target abort interrupt!\n");
 
 	if ((st & AD_DMA_DISR_WAVI) && chip->psubs)
 		snd_pcm_period_elapsed(chip->psubs);
@@ -656,7 +654,7 @@ snd_ad1889_pcm_init(struct snd_ad1889 *chip, int device, struct snd_pcm **rpcm)
 						BUFFER_BYTES_MAX);
 
 	if (err < 0) {
-		snd_printk(KERN_ERR PFX "buffer allocation error: %d\n", err);
+		dev_err(chip->card->dev, "buffer allocation error: %d\n", err);
 		return err;
 	}
 	
@@ -912,7 +910,7 @@ snd_ad1889_create(struct snd_card *card,
 	/* check PCI availability (32bit DMA) */
 	if (pci_set_dma_mask(pci, DMA_BIT_MASK(32)) < 0 ||
 	    pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(32)) < 0) {
-		printk(KERN_ERR PFX "error setting 32-bit DMA mask.\n");
+		dev_err(card->dev, "error setting 32-bit DMA mask.\n");
 		pci_disable_device(pci);
 		return -ENXIO;
 	}
@@ -935,7 +933,7 @@ snd_ad1889_create(struct snd_card *card,
 	chip->bar = pci_resource_start(pci, 0);
 	chip->iobase = pci_ioremap_bar(pci, 0);
 	if (chip->iobase == NULL) {
-		printk(KERN_ERR PFX "unable to reserve region.\n");
+		dev_err(card->dev, "unable to reserve region.\n");
 		err = -EBUSY;
 		goto free_and_ret;
 	}
@@ -946,7 +944,7 @@ snd_ad1889_create(struct snd_card *card,
 
 	if (request_irq(pci->irq, snd_ad1889_interrupt,
 			IRQF_SHARED, KBUILD_MODNAME, chip)) {
-		printk(KERN_ERR PFX "cannot obtain IRQ %d\n", pci->irq);
+		dev_err(card->dev, "cannot obtain IRQ %d\n", pci->irq);
 		snd_ad1889_free(chip);
 		return -EBUSY;
 	}
-- 
1.9.0

  reply	other threads:[~2014-02-26 15:53 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-26 15:53 [PATCH 00/48] Rewrite kernel messages with standard printk helpers Takashi Iwai
2014-02-26 15:53 ` Takashi Iwai [this message]
2014-02-26 15:53 ` [PATCH 02/48] ALSA: als300: Remove function debug prints Takashi Iwai
2014-02-26 15:53 ` [PATCH 03/48] ALSA: als300: Use standard printk helpers Takashi Iwai
2014-02-26 15:53 ` [PATCH 04/48] ALSA: als4000: " Takashi Iwai
2014-02-26 15:53 ` [PATCH 05/48] ALSA: atiixp: " Takashi Iwai
2014-02-26 15:53 ` [PATCH 06/48] ALSA: atiixp-modem: " Takashi Iwai
2014-02-26 15:53 ` [PATCH 07/48] ALSA: azt3328: Remove function debug prints Takashi Iwai
2014-02-26 15:53 ` [PATCH 08/48] ALSA: azt3328: Use standard printk helpers Takashi Iwai
2014-02-26 15:53 ` [PATCH 09/48] ALSA: bt87x: " Takashi Iwai
2014-02-26 15:53 ` [PATCH 10/48] ALSA: cmipci: " Takashi Iwai
2014-02-26 15:53 ` [PATCH 11/48] ALSA: cs4281: " Takashi Iwai
2014-02-26 15:53 ` [PATCH 12/48] ALSA: cs5530: " Takashi Iwai
2014-02-26 15:53 ` [PATCH 13/48] ALSA: ens137x: " Takashi Iwai
2014-02-26 15:53 ` [PATCH 14/48] ALSA: es1938: " Takashi Iwai
2014-02-26 15:53 ` [PATCH 15/48] ALSA: es1968: " Takashi Iwai
2014-02-26 15:53 ` [PATCH 16/48] ALSA: fm801: " Takashi Iwai
2014-02-26 15:53 ` [PATCH 17/48] ALSA: intel8x0: " Takashi Iwai
2014-02-26 15:53 ` [PATCH 18/48] ALSA: intel8x0m: " Takashi Iwai
2014-02-26 15:53 ` [PATCH 19/48] ALSA: maestro3: " Takashi Iwai
2014-02-26 15:53 ` [PATCH 20/48] ALSA: rme32: " Takashi Iwai
2014-02-26 15:53 ` [PATCH 21/48] ALSA: rme96: " Takashi Iwai
2014-02-26 15:53 ` [PATCH 22/48] ALSA: sonicvibes: " Takashi Iwai
2014-02-26 15:53 ` [PATCH 23/48] ALSA: via82xx: " Takashi Iwai
2014-02-26 15:53 ` [PATCH 24/48] ALSA: via82xx_modem: " Takashi Iwai
2014-02-26 15:53 ` [PATCH 25/48] ALSA: ac97: " Takashi Iwai
2014-02-26 15:53 ` [PATCH 26/48] ALSA: ali5451: " Takashi Iwai
2014-02-26 15:53 ` [PATCH 27/48] ALSA: aw2: " Takashi Iwai
2014-02-26 15:53 ` [PATCH 28/48] ALSA: ca0106: " Takashi Iwai
2014-02-26 15:53 ` [PATCH 29/48] ALSA: cs5535audio: " Takashi Iwai
2014-02-26 15:53 ` [PATCH 30/48] ALSA: cs46xx: " Takashi Iwai
2014-02-26 15:53 ` [PATCH 31/48] ALSA: echoaudio: " Takashi Iwai
2014-02-26 15:53 ` [PATCH 32/48] ALSA: emu10k1x: " Takashi Iwai
2014-02-26 15:53 ` [PATCH 33/48] ALSA: emu10k1: " Takashi Iwai
2014-02-26 15:53 ` [PATCH 34/48] ALSA: ice17xx: " Takashi Iwai
2014-02-26 15:53 ` [PATCH 35/48] ALSA: lola: " Takashi Iwai
2014-02-26 15:53 ` [PATCH 36/48] ALSA: lx6464es: " Takashi Iwai
2014-02-26 15:53 ` [PATCH 37/48] ALSA: mixart: " Takashi Iwai
2014-02-26 15:53 ` [PATCH 38/48] ALSA: nm256: " Takashi Iwai
2014-02-26 15:53 ` [PATCH 39/48] ALSA: oxygen: " Takashi Iwai
2014-02-26 15:53 ` [PATCH 40/48] ALSA: pcxhr: " Takashi Iwai
2014-02-26 15:53 ` [PATCH 41/48] ALSA: hdsp: " Takashi Iwai
2014-02-26 15:53 ` [PATCH 42/48] ALSA: hdspm: " Takashi Iwai
2014-02-26 15:53 ` [PATCH 43/48] ALSA: rme9652: " Takashi Iwai
2014-02-26 15:53 ` [PATCH 44/48] ALSA: trident: " Takashi Iwai
2014-02-26 15:53 ` [PATCH 45/48] ALSA: vx222: " Takashi Iwai
2014-02-26 15:53 ` [PATCH 46/48] ALSA: ymfpci: " Takashi Iwai
2014-02-26 15:53 ` [PATCH 47/48] ALSA: usb-audio: " Takashi Iwai
2014-02-26 15:53 ` [PATCH 48/48] ALSA: 6fire: " Takashi Iwai
2014-02-26 16:39   ` Takashi Iwai
     [not found] ` <CAN8cciZQS1XK4aGt6at_gRhMM1Mtp0sFqs80ZKwFHP_YXwHdjg@mail.gmail.com>
2014-02-27  7:40   ` [PATCH 00/48] Rewrite kernel messages with " Takashi Iwai
2014-02-27  8:00     ` Raymond Yau
2014-02-27  8:10       ` Takashi Iwai
2014-02-27 10:43         ` Takashi Iwai
2014-02-27 12:15         ` Raymond Yau
2014-02-27 13:18           ` Takashi Iwai
2014-02-28  3:15     ` Raymond Yau
2014-02-28  6:28       ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1393430030-26704-2-git-send-email-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.