All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: alsa-devel@alsa-project.org
Subject: [PATCH 10/48] ALSA: cmipci: Use standard printk helpers
Date: Wed, 26 Feb 2014 16:53:12 +0100	[thread overview]
Message-ID: <1393430030-26704-11-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.
Some commented debug prints are also enabled as dev_dbg().

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

diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c
index 66c0558ce449..12c318e175f4 100644
--- a/sound/pci/cmipci.c
+++ b/sound/pci/cmipci.c
@@ -796,7 +796,7 @@ static int snd_cmipci_pcm_prepare(struct cmipci *cm, struct cmipci_pcm *rec,
 	if (runtime->channels > 1)
 		rec->fmt |= 0x01;
 	if (rec->is_dac && set_dac_channels(cm, rec, runtime->channels) < 0) {
-		snd_printd("cannot set dac channels\n");
+		dev_dbg(cm->card->dev, "cannot set dac channels\n");
 		return -EINVAL;
 	}
 
@@ -827,7 +827,7 @@ static int snd_cmipci_pcm_prepare(struct cmipci *cm, struct cmipci_pcm *rec,
 	else
 		cm->ctrl |= val;
 	snd_cmipci_write(cm, CM_REG_FUNCTRL0, cm->ctrl);
-	//snd_printd("cmipci: functrl0 = %08x\n", cm->ctrl);
+	/* dev_dbg(cm->card->dev, "functrl0 = %08x\n", cm->ctrl); */
 
 	/* set sample rate */
 	freq = 0;
@@ -850,7 +850,7 @@ static int snd_cmipci_pcm_prepare(struct cmipci *cm, struct cmipci_pcm *rec,
 		val |= (freq << CM_ASFC_SHIFT) & CM_ASFC_MASK;
 	}
 	snd_cmipci_write(cm, CM_REG_FUNCTRL1, val);
-	//snd_printd("cmipci: functrl1 = %08x\n", val);
+	dev_dbg(cm->card->dev, "functrl1 = %08x\n", val);
 
 	/* set format */
 	val = snd_cmipci_read(cm, CM_REG_CHFORMAT);
@@ -866,7 +866,7 @@ static int snd_cmipci_pcm_prepare(struct cmipci *cm, struct cmipci_pcm *rec,
 		val |= freq_ext << (rec->ch * 2);
 	}
 	snd_cmipci_write(cm, CM_REG_CHFORMAT, val);
-	//snd_printd("cmipci: chformat = %08x\n", val);
+	dev_dbg(cm->card->dev, "chformat = %08x\n", val);
 
 	if (!rec->is_dac && cm->chip_version) {
 		if (runtime->rate > 44100)
@@ -904,7 +904,7 @@ static int snd_cmipci_pcm_trigger(struct cmipci *cm, struct cmipci_pcm *rec,
 		cm->ctrl |= chen;
 		/* enable channel */
 		snd_cmipci_write(cm, CM_REG_FUNCTRL0, cm->ctrl);
-		//snd_printd("cmipci: functrl0 = %08x\n", cm->ctrl);
+		dev_dbg(cm->card->dev, "functrl0 = %08x\n", cm->ctrl);
 		break;
 	case SNDRV_PCM_TRIGGER_STOP:
 		rec->running = 0;
@@ -952,7 +952,7 @@ static snd_pcm_uframes_t snd_cmipci_pcm_pointer(struct cmipci *cm, struct cmipci
 		if (rem < rec->dma_size)
 			goto ok;
 	} 
-	printk(KERN_ERR "cmipci: invalid PCM pointer: %#x\n", rem);
+	dev_err(cm->card->dev, "invalid PCM pointer: %#x\n", rem);
 	return SNDRV_PCM_POS_XRUN;
 ok:
 	ptr = (rec->dma_size - (rem + 1)) >> rec->shift;
@@ -2889,13 +2889,13 @@ static int snd_cmipci_create_gameport(struct cmipci *cm, int dev)
 	}
 
 	if (!r) {
-		printk(KERN_WARNING "cmipci: cannot reserve joystick ports\n");
+		dev_warn(cm->card->dev, "cannot reserve joystick ports\n");
 		return -EBUSY;
 	}
 
 	cm->gameport = gp = gameport_allocate_port();
 	if (!gp) {
-		printk(KERN_ERR "cmipci: cannot allocate memory for gameport\n");
+		dev_err(cm->card->dev, "cannot allocate memory for gameport\n");
 		release_and_free_resource(r);
 		return -ENOMEM;
 	}
@@ -2995,13 +2995,14 @@ static int snd_cmipci_create_fm(struct cmipci *cm, long fm_port)
 
 		if (snd_opl3_create(cm->card, iosynth, iosynth + 2,
 				    OPL3_HW_OPL3, 0, &opl3) < 0) {
-			printk(KERN_ERR "cmipci: no OPL device at %#lx, "
-			       "skipping...\n", iosynth);
+			dev_err(cm->card->dev,
+				"no OPL device at %#lx, skipping...\n",
+				iosynth);
 			goto disable_fm;
 		}
 	}
 	if ((err = snd_opl3_hwdep_new(opl3, 0, 1, NULL)) < 0) {
-		printk(KERN_ERR "cmipci: cannot create OPL3 hwdep\n");
+		dev_err(cm->card->dev, "cannot create OPL3 hwdep\n");
 		return err;
 	}
 	return 0;
@@ -3060,7 +3061,7 @@ static int snd_cmipci_create(struct snd_card *card, struct pci_dev *pci,
 
 	if (request_irq(pci->irq, snd_cmipci_interrupt,
 			IRQF_SHARED, KBUILD_MODNAME, cm)) {
-		snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
+		dev_err(card->dev, "unable to grab IRQ %d\n", pci->irq);
 		snd_cmipci_free(cm);
 		return -EBUSY;
 	}
@@ -3192,8 +3193,9 @@ static int snd_cmipci_create(struct snd_card *card, struct pci_dev *pci,
 			/* enable UART */
 			snd_cmipci_set_bit(cm, CM_REG_FUNCTRL1, CM_UART_EN);
 			if (inb(iomidi + 1) == 0xff) {
-				snd_printk(KERN_ERR "cannot enable MPU-401 port"
-					   " at %#lx\n", iomidi);
+				dev_err(cm->card->dev,
+					"cannot enable MPU-401 port at %#lx\n",
+					iomidi);
 				snd_cmipci_clear_bit(cm, CM_REG_FUNCTRL1,
 						     CM_UART_EN);
 				iomidi = 0;
@@ -3237,7 +3239,8 @@ static int snd_cmipci_create(struct snd_card *card, struct pci_dev *pci,
 						MPU401_INFO_INTEGRATED : 0) |
 					       MPU401_INFO_IRQ_HOOK,
 					       -1, &cm->rmidi)) < 0) {
-			printk(KERN_ERR "cmipci: no UART401 device at 0x%lx\n", iomidi);
+			dev_err(cm->card->dev,
+				"no UART401 device at 0x%lx\n", iomidi);
 		}
 	}
 
@@ -3380,8 +3383,7 @@ static int snd_cmipci_resume(struct device *dev)
 	pci_set_power_state(pci, PCI_D0);
 	pci_restore_state(pci);
 	if (pci_enable_device(pci) < 0) {
-		printk(KERN_ERR "cmipci: pci_enable_device failed, "
-		       "disabling device\n");
+		dev_err(dev, "pci_enable_device failed, disabling device\n");
 		snd_card_disconnect(card);
 		return -EIO;
 	}
-- 
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 ` Takashi Iwai [this message]
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-11-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.