aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2010-11-11 02:09:08 +0100
committerTakashi Iwai <tiwai@suse.de>2010-11-11 02:09:08 +0100
commitf4c2055d7932e92cd2bdb4bd9a3fa4aa4e0ebb73 (patch)
treef077567f7759e7176daee0aeadec1e55b338df51
parent36a91e1c2d43fce14c8b81010dbc69f100becfc3 (diff)
downloadalsa-driver-build-unstable-f4c2055d7932e92cd2bdb4bd9a3fa4aa4e0ebb73.tar.gz
Add vzalloc() wrapper
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--include/adriver.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/adriver.h b/include/adriver.h
index 35418e1cb..2a2f1aa64 100644
--- a/include/adriver.h
+++ b/include/adriver.h
@@ -1920,6 +1920,18 @@ static inline int hex_to_bin(char c)
}
#endif
+/* vzalloc() wrapper */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37)
+#include <linux/vmalloc.h>
+static inline void *vzalloc(unsigned long size)
+{
+ void *p = vmalloc(size);
+ if (p)
+ memset(p, 0, size);
+ return p;
+}
+#endif
+
/* hack - CONFIG_SND_HDA_INPUT_JACK can be wrongly set for older kernels */
#ifndef CONFIG_SND_JACK
#undef CONFIG_SND_HDA_INPUT_JACK