[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <AANLkTim07cvTwm+KfY=Fh6SofQWyPV_3ns7qKAjzpN=d@mail.gmail.com>
Date: Mon, 21 Mar 2011 17:49:49 -0700
From: Dan Williams <dan.j.williams@...el.com>
To: "Ira W. Snyder" <iws@...o.caltech.edu>
Cc: linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
leoli@...escale.com
Subject: Re: [PATCH v3 3/9] fsldma: use channel name in printk output
On Thu, Mar 3, 2011 at 9:54 AM, Ira W. Snyder <iws@...o.caltech.edu> 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 <iws@...o.caltech.edu>
> ---
> drivers/dma/fsldma.c | 69 +++++++++++++++++++++++++------------------------
> drivers/dma/fsldma.h | 1 +
> 2 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 @@
>
> #include "fsldma.h"
>
> -static const char msg_ld_oom[] = "No free memory for link descriptor\n";
> +#define chan_dbg(chan, fmt, arg...) \
> + dev_dbg(chan->dev, "%s: " fmt, chan->name, ##arg)
> +#define chan_err(chan, fmt, arg...) \
> + 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists