@@ -36,9 +36,6 @@ enum shdma_desc_status {
#define NR_DESCS_PER_CHANNEL 32
-#define to_shdma_chan(c) container_of(c, struct shdma_chan, dma_chan)
-#define to_shdma_dev(d) container_of(d, struct shdma_dev, dma_dev)
-
/*
* For slave DMA we assume, that there is a finite number of DMA slaves in the
* system, and that each such slave can only use a finite number of channels.
@@ -17,8 +17,6 @@
#include <linux/platform_device.h>
#include <linux/shdma-base.h>
-#define to_shdma_chan(c) container_of(c, struct shdma_chan, dma_chan)
-
static struct dma_chan *shdma_of_xlate(struct of_phandle_args *dma_spec,
struct of_dma *ofdma)
{
@@ -114,6 +114,9 @@ struct shdma_dev {
#define shdma_for_each_chan(c, d, i) for (i = 0, c = (d)->schan[0]; \
i < (d)->dma_dev.chancnt; c = (d)->schan[++i])
+#define to_shdma_chan(c) container_of(c, struct shdma_chan, dma_chan)
+#define to_shdma_dev(d) container_of(d, struct shdma_dev, dma_dev)
+
int shdma_request_irq(struct shdma_chan *, int,
unsigned long, const char *);
bool shdma_reset(struct shdma_dev *sdev);
Move two generic pointer-conversion macros to a header for common shdma use. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com> --- drivers/dma/sh/shdma-base.c | 3 --- drivers/dma/sh/shdma-of.c | 2 -- include/linux/shdma-base.h | 3 +++ 3 files changed, 3 insertions(+), 5 deletions(-)