@@ -54,25 +54,28 @@ static void rsnd_dmaen_complete(void *data)
#define DMA_NAME_SIZE 16
#define MOD_MAX 4 /* MEM/SSI/SRC/DVC */
-static int _rsnd_dmaen_of_name(char *dma_name, struct rsnd_mod *mod)
-{
- if (mod)
- return snprintf(dma_name, DMA_NAME_SIZE / 2, "%s%d",
- rsnd_mod_dma_name(mod), rsnd_mod_id(mod));
- else
- return snprintf(dma_name, DMA_NAME_SIZE / 2, "mem");
-
-}
static void rsnd_dmaen_of_name(struct rsnd_mod *mod_from,
struct rsnd_mod *mod_to,
char *dma_name)
{
- int index = 0;
+ char *fmt;
+ struct rsnd_mod *mod;
+
+ if ((!mod_from && !mod_to) ||
+ (mod_from && mod_to))
+ return;
+
+ if (mod_from) {
+ fmt = "%s%d-tx";
+ mod = mod_from;
+ } else {
+ fmt = "%s%d-rx";
+ mod = mod_to;
+ }
- index = _rsnd_dmaen_of_name(dma_name + index, mod_from);
- *(dma_name + index++) = '_';
- index = _rsnd_dmaen_of_name(dma_name + index, mod_to);
+ snprintf(dma_name, DMA_NAME_SIZE, fmt,
+ rsnd_mod_dma_name(mod), rsnd_mod_id(mod));
}
static void rsnd_dmaen_stop(struct rsnd_dma *dma)