dsp: update MSM Audio ION wrappers to align with upstream

Between Linux-4.9 and Linux-4.14, upstream has updated the
ION APIs significantly to make ION ready to bring out of
staging folder. This has changed the way ION and dma_buf
APIs used to work together for allocating, mapping and
deallocating ION buffers.
Update MSM Audio ION wrapper functions used by audio drivers
to reflect these ION API changes as per upstream ION.

Change-Id: I63097e147a397aa3a538f69ac88b6fb10871c3dc
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
diff --git a/asoc/msm-pcm-q6-noirq.c b/asoc/msm-pcm-q6-noirq.c
index dbc6d33..34dc4bb 100644
--- a/asoc/msm-pcm-q6-noirq.c
+++ b/asoc/msm-pcm-q6-noirq.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2016-2017, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
@@ -20,6 +20,7 @@
 #include <linux/slab.h>
 #include <linux/of_device.h>
 #include <linux/dma-mapping.h>
+#include <linux/dma-buf.h>
 
 #include <sound/core.h>
 #include <sound/soc.h>
@@ -451,7 +452,13 @@
 
 	apd = prtd->audio_client->port;
 	ab = &(apd[dir].buf[0]);
-	mmap_fd->fd = ion_share_dma_buf_fd(ab->client, ab->handle);
+	/*
+	 * Passing O_CLOEXEC as flag passed to fd, to be in sync with
+	 * previous implimentation.
+	 * This was the flag used by previous internal wrapper API, which
+	 * used to call dma_buf_fd internally.
+	 */
+	mmap_fd->fd = dma_buf_fd(ab->dma_buf, O_CLOEXEC);
 	if (mmap_fd->fd >= 0) {
 		mmap_fd->dir = dir;
 		mmap_fd->actual_size = ab->actual_size;