include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit...
[safe/jmp/linux-2.6] / sound / soc / txx9 / txx9aclc.c
index fa33661..49cc7ea 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/scatterlist.h>
+#include <linux/slab.h>
 #include <sound/core.h>
 #include <sound/pcm.h>
 #include <sound/pcm_params.h>
@@ -297,15 +298,17 @@ static int txx9aclc_pcm_new(struct snd_card *card, struct snd_soc_dai *dai,
 static bool filter(struct dma_chan *chan, void *param)
 {
        struct txx9aclc_dmadata *dmadata = param;
-       char devname[BUS_ID_SIZE + 2];
+       char *devname;
+       bool found = false;
 
-       sprintf(devname, "%s.%d", dmadata->dma_res->name,
+       devname = kasprintf(GFP_KERNEL, "%s.%d", dmadata->dma_res->name,
                (int)dmadata->dma_res->start);
        if (strcmp(dev_name(chan->device->dev), devname) == 0) {
                chan->private = &dmadata->dma_slave;
-               return true;
+               found = true;
        }
-       return false;
+       kfree(devname);
+       return found;
 }
 
 static int txx9aclc_dma_init(struct txx9aclc_soc_device *dev,