Re: [PATCH v3 3/9] fsldma: use channel name in printk output
From: Dan Williams <hidden>
Date: 2011-03-22 00:49:56
Also in:
lkml
On Thu, Mar 3, 2011 at 9:54 AM, Ira W. Snyder [off-list ref] wrote:
This makes debugging the driver much easier when multiple channels are running concurrently. In addition, you can see how much descriptor memory each channel has allocated via the dmapool API in sysfs. Signed-off-by: Ira W. Snyder <redacted> --- =A0drivers/dma/fsldma.c | =A0 69 +++++++++++++++++++++++++---------------=
---------
quoted hunk ↗ jump to hunk
=A0drivers/dma/fsldma.h | =A0 =A01 + =A02 files changed, 36 insertions(+), 34 deletions(-)diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c index 2e1af45..e535cd1 100644 --- a/drivers/dma/fsldma.c +++ b/drivers/dma/fsldma.c@@ -37,7 +37,12 @@=A0#include "fsldma.h" -static const char msg_ld_oom[] =3D "No free memory for link descriptor\n=
";
+#define chan_dbg(chan, fmt, arg...) =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0\
+ =A0 =A0 =A0 dev_dbg(chan->dev, "%s: " fmt, chan->name, ##arg) +#define chan_err(chan, fmt, arg...) =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0\
+ =A0 =A0 =A0 dev_err(chan->dev, "%s: " fmt, chan->name, ##arg) +
I already have this applied, but if you want to send an incremental cleanup patch you could achieve a similar effect without increasing the size of fsldma_chan by using the class device that is created by dma_async_device_register. Something like: #define to_chan_dev(chan) (&chan->common.dev->device) #define chan_err(chan, fmt, arg...) \ dev_err(chan->dev, "%s: " fmt, dev_name(to_chan_dev(chan)), ##arg) ...where dev_name() returns something like "dma0chan0". -- Dan