All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roel Kluin <12o3l@tiscali.nl>
To: kernel-janitors@vger.kernel.org
Subject: [PATCH] sa1100 dma s/DPRINTK/pr_debug/
Date: Sat, 29 Sep 2007 10:31:30 +0000	[thread overview]
Message-ID: <46FE2982.3070405@tiscali.nl> (raw)

I replaced a DPRINTK with pr_debug and was wondering whether I was doing it
correctly. See the example changes to arch/arm/mach-sa1100/dma.c, diffed 
against the current git.

* Are the changes in arch/arm/mach-sa1100/kconfig files also required?
* Should changes be made to the arch/arm/mach-sa1100/Makefile?
* Is an '#undef DEBUG' at the end not required?

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
---
diff --git a/arch/arm/mach-sa1100/Kconfig b/arch/arm/mach-sa1100/Kconfig
index f99d901..f81c323 100644
--- a/arch/arm/mach-sa1100/Kconfig
+++ b/arch/arm/mach-sa1100/Kconfig
@@ -157,6 +157,11 @@ config SA1100_SSP
 	  This isn't for audio support, but for attached sensors and
 	  other devices, eg for BadgePAD 4 sensor support.
 
+config SA1100_DMA_DEBUG
+	bool "dma"
+	help
+	  Say Y here if you want verbose debugging for StrongARM 1110 dma.
+
 config H3600_SLEEVE
 	tristate "Compaq iPAQ Handheld sleeve support"
 	depends on SA1100_H3100 || SA1100_H3600
diff --git a/arch/arm/mach-sa1100/dma.c b/arch/arm/mach-sa1100/dma.c
index 1fbe053..d925dda 100644
--- a/arch/arm/mach-sa1100/dma.c
+++ b/arch/arm/mach-sa1100/dma.c
@@ -22,11 +22,8 @@
 #include <asm/dma.h>
 
 
-#undef DEBUG
-#ifdef DEBUG
-#define DPRINTK( s, arg... )  printk( "dma<%p>: " s, regs , ##arg )
-#else
-#define DPRINTK( x... )
+#ifdef CONFIG_SA1100_DMA_DEBUG
+#	define DEBUG 1
 #endif
 
 
@@ -232,7 +229,7 @@ int sa1100_start_dma(dma_regs_t *regs, dma_addr_t dma_ptr, u_int size)
 
 	/* If both DMA buffers are started, there's nothing else we can do. */
 	if ((status & (DCSR_STRTA | DCSR_STRTB)) = (DCSR_STRTA | DCSR_STRTB)) {
-		DPRINTK("start: st %#x busy\n", status);
+		pr_debug("dma<%p>: start: st %#x busy\n", regs , status);
 		ret = -EBUSY;
 		goto out;
 	}
@@ -247,7 +244,7 @@ int sa1100_start_dma(dma_regs_t *regs, dma_addr_t dma_ptr, u_int size)
 		regs->DBSA = dma_ptr;
 		regs->DBTA = size;
 		regs->SetDCSR = DCSR_STRTA | DCSR_IE | DCSR_RUN;
-		DPRINTK("start a=%#x s=%d on A\n", dma_ptr, size);
+		pr_debug("dma<%p>: start a=%#x s=%d on A\n", regs , dma_ptr, size);
 	} else {
 		if (status & DCSR_DONEB) {
 			/* give a chance for the interrupt to be processed */
@@ -257,7 +254,7 @@ int sa1100_start_dma(dma_regs_t *regs, dma_addr_t dma_ptr, u_int size)
 		regs->DBSB = dma_ptr;
 		regs->DBTB = size;
 		regs->SetDCSR = DCSR_STRTB | DCSR_IE | DCSR_RUN;
-		DPRINTK("start a=%#x s=%d on B\n", dma_ptr, size);
+		pr_debug("dma<%p>: start a=%#x s=%d on B\n", regs , dma_ptr, size);
 	}
 	ret = 0;
 

             reply	other threads:[~2007-09-29 10:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-29 10:31 Roel Kluin [this message]
2007-09-29 17:45 ` [PATCH] sa1100 dma s/DPRINTK/pr_debug/ Randy Dunlap

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=46FE2982.3070405@tiscali.nl \
    --to=12o3l@tiscali.nl \
    --cc=kernel-janitors@vger.kernel.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.