summaryrefslogtreecommitdiffstats
path: root/alsa.h
diff options
context:
space:
mode:
authorMark Farrugia <mark.farrugia@fiberdyne.com.au>2018-09-20 12:09:20 +1000
committerMark Farrugia <mark.farrugia@fiberdyne.com.au>2018-10-26 17:27:33 +1100
commit3786b607d4dd5e738cbe491dbfb03c2283e74358 (patch)
tree83f150ee7eee8ab42d827f6a1b3c5af68ac9fcbd /alsa.h
parent99a09bc4fe16d275b2bf839cb8f37192b2235e24 (diff)
Add 'uid' field to AP, store AP in PCM private data, fix helper macros
We want to use a UID when registering APs, that must start with "ap_", and acts as a unique identifier for each AP. To move forward with the adoption of routing PCMs to differing APs, we now store the AP in the PCM private data - set at pcm_open. A fix to the helper macros now allows additional args to be passed in for inclusion to the debug string Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
Diffstat (limited to 'alsa.h')
-rwxr-xr-xalsa.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/alsa.h b/alsa.h
index 12148b9..c22a93c 100755
--- a/alsa.h
+++ b/alsa.h
@@ -13,10 +13,11 @@
#include "core.h"
#include <linux/platform_device.h>
+#include <linux/slab.h>
#include <sound/pcm.h>
-#define PRINT_ERR(errno, errmsg, ...) \
- pr_err("[%s()] %s [ERRNO:%d]", __func__, errmsg, ##__VA_ARGS__, errno);
+#define PRINT_ERR(errno, errmsg) \
+ pr_err("[%s]:[ERRNO:%d]: %s ", __func__, errno, (errmsg));
#define CHK_ERR(errno) \
do { \
@@ -38,12 +39,15 @@
return -EFAULT; \
} while (0)
-#define CHK_NULL_V(x, errmsg, ...) \
- do { \
- if (!(x)) { \
- PRINT_ERR(EFAULT, (errmsg), ##__VA_ARGS__) \
- return -EFAULT; \
- } \
+#define CHK_NULL_V(x, errmsg, ...) \
+ do { \
+ if (!(x)) { \
+ char *errmsg_done = \
+ kasprintf(GFP_KERNEL, errmsg, ##__VA_ARGS__); \
+ PRINT_ERR(EFAULT, errmsg_done); \
+ kfree(errmsg_done); \
+ return -EFAULT; \
+ } \
} while (0)
extern struct avirt_coreinfo coreinfo;