All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: alsa-devel@alsa-project.org
Subject: [PATCH 38/48] ALSA: nm256: Use standard printk helpers
Date: Wed, 26 Feb 2014 16:53:40 +0100	[thread overview]
Message-ID: <1393430030-26704-39-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/nm256/nm256.c | 75 ++++++++++++++++++++++++++++---------------------
 1 file changed, 43 insertions(+), 32 deletions(-)

diff --git a/sound/pci/nm256/nm256.c b/sound/pci/nm256/nm256.c
index b7afd9c8dcd7..ddc60215cc10 100644
--- a/sound/pci/nm256/nm256.c
+++ b/sound/pci/nm256/nm256.c
@@ -318,7 +318,8 @@ snd_nm256_write_buffer(struct nm256 *chip, void *src, int offset, int size)
 	offset -= chip->buffer_start;
 #ifdef CONFIG_SND_DEBUG
 	if (offset < 0 || offset >= chip->buffer_size) {
-		snd_printk(KERN_ERR "write_buffer invalid offset = %d size = %d\n",
+		dev_err(chip->card->dev,
+			"write_buffer invalid offset = %d size = %d\n",
 			   offset, size);
 		return;
 	}
@@ -366,7 +367,8 @@ snd_nm256_load_coefficient(struct nm256 *chip, int stream, int number)
 		 NM_RECORD_REG_OFFSET : NM_PLAYBACK_REG_OFFSET);
 
 	if (snd_nm256_readb(chip, poffset) & 1) {
-		snd_printd("NM256: Engine was enabled while loading coefficients!\n");
+		dev_dbg(chip->card->dev,
+			"NM256: Engine was enabled while loading coefficients!\n");
 		return;
 	}
 
@@ -466,7 +468,8 @@ static int snd_nm256_acquire_irq(struct nm256 *chip)
 	if (chip->irq < 0) {
 		if (request_irq(chip->pci->irq, chip->interrupt, IRQF_SHARED,
 				KBUILD_MODNAME, chip)) {
-			snd_printk(KERN_ERR "unable to grab IRQ %d\n", chip->pci->irq);
+			dev_err(chip->card->dev,
+				"unable to grab IRQ %d\n", chip->pci->irq);
 			mutex_unlock(&chip->irq_mutex);
 			return -EBUSY;
 		}
@@ -1039,7 +1042,7 @@ snd_nm256_interrupt(int irq, void *dev_id)
 	if (status & NM_MISC_INT_1) {
 		status &= ~NM_MISC_INT_1;
 		NM_ACK_INT(chip, NM_MISC_INT_1);
-		snd_printd("NM256: Got misc interrupt #1\n");
+		dev_dbg(chip->card->dev, "NM256: Got misc interrupt #1\n");
 		snd_nm256_writew(chip, NM_INT_REG, 0x8000);
 		cbyte = snd_nm256_readb(chip, 0x400);
 		snd_nm256_writeb(chip, 0x400, cbyte | 2);
@@ -1048,14 +1051,15 @@ snd_nm256_interrupt(int irq, void *dev_id)
 	if (status & NM_MISC_INT_2) {
 		status &= ~NM_MISC_INT_2;
 		NM_ACK_INT(chip, NM_MISC_INT_2);
-		snd_printd("NM256: Got misc interrupt #2\n");
+		dev_dbg(chip->card->dev, "NM256: Got misc interrupt #2\n");
 		cbyte = snd_nm256_readb(chip, 0x400);
 		snd_nm256_writeb(chip, 0x400, cbyte & ~2);
 	}
 
 	/* Unknown interrupt. */
 	if (status) {
-		snd_printd("NM256: Fire in the hole! Unknown status 0x%x\n",
+		dev_dbg(chip->card->dev,
+			"NM256: Fire in the hole! Unknown status 0x%x\n",
 			   status);
 		/* Pray. */
 		NM_ACK_INT(chip, status);
@@ -1104,7 +1108,7 @@ snd_nm256_interrupt_zx(int irq, void *dev_id)
 	if (status & NM2_MISC_INT_1) {
 		status &= ~NM2_MISC_INT_1;
 		NM2_ACK_INT(chip, NM2_MISC_INT_1);
-		snd_printd("NM256: Got misc interrupt #1\n");
+		dev_dbg(chip->card->dev, "NM256: Got misc interrupt #1\n");
 		cbyte = snd_nm256_readb(chip, 0x400);
 		snd_nm256_writeb(chip, 0x400, cbyte | 2);
 	}
@@ -1112,14 +1116,15 @@ snd_nm256_interrupt_zx(int irq, void *dev_id)
 	if (status & NM2_MISC_INT_2) {
 		status &= ~NM2_MISC_INT_2;
 		NM2_ACK_INT(chip, NM2_MISC_INT_2);
-		snd_printd("NM256: Got misc interrupt #2\n");
+		dev_dbg(chip->card->dev, "NM256: Got misc interrupt #2\n");
 		cbyte = snd_nm256_readb(chip, 0x400);
 		snd_nm256_writeb(chip, 0x400, cbyte & ~2);
 	}
 
 	/* Unknown interrupt. */
 	if (status) {
-		snd_printd("NM256: Fire in the hole! Unknown status 0x%x\n",
+		dev_dbg(chip->card->dev,
+			"NM256: Fire in the hole! Unknown status 0x%x\n",
 			   status);
 		/* Pray. */
 		NM2_ACK_INT(chip, status);
@@ -1245,7 +1250,7 @@ snd_nm256_ac97_write(struct snd_ac97 *ac97,
 			return;
 		}
 	}
-	snd_printd("nm256: ac97 codec not ready..\n");
+	dev_dbg(chip->card->dev, "nm256: ac97 codec not ready..\n");
 }
 
 /* static resolution table */
@@ -1347,7 +1352,8 @@ snd_nm256_peek_for_sig(struct nm256 *chip)
 
 	temp = ioremap_nocache(chip->buffer_addr + chip->buffer_end - 0x400, 16);
 	if (temp == NULL) {
-		snd_printk(KERN_ERR "Unable to scan for card signature in video RAM\n");
+		dev_err(chip->card->dev,
+			"Unable to scan for card signature in video RAM\n");
 		return -EBUSY;
 	}
 
@@ -1361,12 +1367,14 @@ snd_nm256_peek_for_sig(struct nm256 *chip)
 		if (pointer == 0xffffffff ||
 		    pointer < chip->buffer_size ||
 		    pointer > chip->buffer_end) {
-			snd_printk(KERN_ERR "invalid signature found: 0x%x\n", pointer);
+			dev_err(chip->card->dev,
+				"invalid signature found: 0x%x\n", pointer);
 			iounmap(temp);
 			return -ENODEV;
 		} else {
 			pointer_found = pointer;
-			printk(KERN_INFO "nm256: found card signature in video RAM: 0x%x\n",
+			dev_info(chip->card->dev,
+				 "found card signature in video RAM: 0x%x\n",
 			       pointer);
 		}
 	}
@@ -1411,8 +1419,7 @@ static int nm256_resume(struct device *dev)
 	pci_set_power_state(pci, PCI_D0);
 	pci_restore_state(pci);
 	if (pci_enable_device(pci) < 0) {
-		printk(KERN_ERR "nm256: pci_enable_device failed, "
-		       "disabling device\n");
+		dev_err(dev, "pci_enable_device failed, disabling device\n");
 		snd_card_disconnect(card);
 		return -EIO;
 	}
@@ -1520,14 +1527,15 @@ snd_nm256_create(struct snd_card *card, struct pci_dev *pci,
 	chip->res_cport = request_mem_region(chip->cport_addr, NM_PORT2_SIZE,
 					     card->driver);
 	if (chip->res_cport == NULL) {
-		snd_printk(KERN_ERR "memory region 0x%lx (size 0x%x) busy\n",
+		dev_err(card->dev, "memory region 0x%lx (size 0x%x) busy\n",
 			   chip->cport_addr, NM_PORT2_SIZE);
 		err = -EBUSY;
 		goto __error;
 	}
 	chip->cport = ioremap_nocache(chip->cport_addr, NM_PORT2_SIZE);
 	if (chip->cport == NULL) {
-		snd_printk(KERN_ERR "unable to map control port %lx\n", chip->cport_addr);
+		dev_err(card->dev, "unable to map control port %lx\n",
+			chip->cport_addr);
 		err = -ENOMEM;
 		goto __error;
 	}
@@ -1537,12 +1545,14 @@ snd_nm256_create(struct snd_card *card, struct pci_dev *pci,
 		pval = snd_nm256_readw(chip, NM_MIXER_PRESENCE);
 		if ((pval & NM_PRESENCE_MASK) != NM_PRESENCE_VALUE) {
 			if (! force_ac97) {
-				printk(KERN_ERR "nm256: no ac97 is found!\n");
-				printk(KERN_ERR "  force the driver to load by "
-				       "passing in the module parameter\n");
-				printk(KERN_ERR "    force_ac97=1\n");
-				printk(KERN_ERR "  or try sb16, opl3sa2, or "
-				       "cs423x drivers instead.\n");
+				dev_err(card->dev,
+					"no ac97 is found!\n");
+				dev_err(card->dev,
+					"force the driver to load by passing in the module parameter\n");
+				dev_err(card->dev,
+					" force_ac97=1\n");
+				dev_err(card->dev,
+					"or try sb16, opl3sa2, or cs423x drivers instead.\n");
 				err = -ENXIO;
 				goto __error;
 			}
@@ -1581,14 +1591,14 @@ snd_nm256_create(struct snd_card *card, struct pci_dev *pci,
 	chip->buffer_start = chip->buffer_end - chip->buffer_size;
 	chip->buffer_addr += chip->buffer_start;
 
-	printk(KERN_INFO "nm256: Mapping port 1 from 0x%x - 0x%x\n",
+	dev_info(card->dev, "Mapping port 1 from 0x%x - 0x%x\n",
 	       chip->buffer_start, chip->buffer_end);
 
 	chip->res_buffer = request_mem_region(chip->buffer_addr,
 					      chip->buffer_size,
 					      card->driver);
 	if (chip->res_buffer == NULL) {
-		snd_printk(KERN_ERR "nm256: buffer 0x%lx (size 0x%x) busy\n",
+		dev_err(card->dev, "buffer 0x%lx (size 0x%x) busy\n",
 			   chip->buffer_addr, chip->buffer_size);
 		err = -EBUSY;
 		goto __error;
@@ -1596,7 +1606,8 @@ snd_nm256_create(struct snd_card *card, struct pci_dev *pci,
 	chip->buffer = ioremap_nocache(chip->buffer_addr, chip->buffer_size);
 	if (chip->buffer == NULL) {
 		err = -ENOMEM;
-		snd_printk(KERN_ERR "unable to map ring buffer at %lx\n", chip->buffer_addr);
+		dev_err(card->dev, "unable to map ring buffer at %lx\n",
+			chip->buffer_addr);
 		goto __error;
 	}
 
@@ -1658,12 +1669,12 @@ static int snd_nm256_probe(struct pci_dev *pci,
 
 	q = snd_pci_quirk_lookup(pci, nm256_quirks);
 	if (q) {
-		snd_printdd(KERN_INFO "nm256: Enabled quirk for %s.\n",
+		dev_dbg(&pci->dev, "Enabled quirk for %s.\n",
 			    snd_pci_quirk_name(q));
 		switch (q->value) {
 		case NM_BLACKLISTED:
-			printk(KERN_INFO "nm256: The device is blacklisted. "
-			       "Loading stopped\n");
+			dev_info(&pci->dev,
+				 "The device is blacklisted. Loading stopped\n");
 			return -ENODEV;
 		case NM_RESET_WORKAROUND_2:
 			reset_workaround_2 = 1;
@@ -1689,7 +1700,7 @@ static int snd_nm256_probe(struct pci_dev *pci,
 		strcpy(card->driver, "NM256XL+");
 		break;
 	default:
-		snd_printk(KERN_ERR "invalid device id 0x%x\n", pci->device);
+		dev_err(&pci->dev, "invalid device id 0x%x\n", pci->device);
 		snd_card_free(card);
 		return -EINVAL;
 	}
@@ -1712,12 +1723,12 @@ static int snd_nm256_probe(struct pci_dev *pci,
 	card->private_data = chip;
 
 	if (reset_workaround) {
-		snd_printdd(KERN_INFO "nm256: reset_workaround activated\n");
+		dev_dbg(&pci->dev, "reset_workaround activated\n");
 		chip->reset_workaround = 1;
 	}
 
 	if (reset_workaround_2) {
-		snd_printdd(KERN_INFO "nm256: reset_workaround_2 activated\n");
+		dev_dbg(&pci->dev, "reset_workaround_2 activated\n");
 		chip->reset_workaround_2 = 1;
 	}
 
-- 
1.9.0

  parent 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 ` [PATCH 01/48] ALSA: ad1889: Use " Takashi Iwai
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 ` Takashi Iwai [this message]
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-39-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.