aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-06-10 15:51:10 +0200
committerTakashi Iwai <tiwai@suse.de>2011-06-10 15:51:10 +0200
commitcbde0250d1d17cb5d457b2f0e567e6d0edd7bfb1 (patch)
tree332f97358bb9f18c8417433178dd8388844ab885
parent10579acf551b808115c31a1fa503667cbcbf4fc3 (diff)
downloadalsa-driver-build-unstable-cbde0250d1d17cb5d457b2f0e567e6d0edd7bfb1.tar.gz
Fix snd_printk() helper build for older kernels without %pV support
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--acore/misc.patch67
1 files changed, 63 insertions, 4 deletions
diff --git a/acore/misc.patch b/acore/misc.patch
index 8862c4433..dfb1261c5 100644
--- a/acore/misc.patch
+++ b/acore/misc.patch
@@ -1,5 +1,5 @@
---- ../alsa-kernel/core/misc.c 2010-01-14 09:24:33.415809949 +0100
-+++ misc.c 2010-01-14 09:30:42.691557398 +0100
+--- ../alsa-kernel/core/misc.c 2011-06-10 15:36:34.870352164 +0200
++++ misc.c 2011-06-10 15:49:50.133251884 +0200
@@ -1,3 +1,9 @@
+#define __NO_VERSION__
+#include "adriver.h"
@@ -10,7 +10,7 @@
/*
* Misc and compatibility things
* Copyright (c) by Jaroslav Kysela <perex@perex.cz>
-@@ -42,7 +48,7 @@
+@@ -43,7 +49,7 @@
{
if (res) {
release_resource(res);
@@ -19,7 +19,66 @@
}
}
-@@ -143,9 +149,42 @@
+@@ -58,6 +64,25 @@
+ else
+ return path;
+ }
++/* print file and line with a certain printk prefix */
++static int print_snd_pfx(unsigned int level, const char *path, int line,
++ const char *format)
++{
++ const char *file = sanity_file_name(path);
++ char tmp[] = "<0>";
++ const char *pfx = level ? KERN_DEBUG : KERN_DEFAULT;
++ int ret = 0;
++
++ if (format[0] == '<' && format[2] == '>') {
++ tmp[1] = format[1];
++ pfx = tmp;
++ ret = 1;
++ }
++ printk("%sALSA %s:%d: ", pfx, file, line);
++ return ret;
++}
++#else
++#define print_snd_pfx(level, path, line, format) 0
+ #endif
+
+ #if defined(CONFIG_SND_DEBUG) || defined(CONFIG_SND_VERBOSE_PRINTK)
+@@ -65,10 +90,12 @@
+ const char *format, ...)
+ {
+ va_list args;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36)
+ #ifdef CONFIG_SND_VERBOSE_PRINTK
+ struct va_format vaf;
+ char verbose_fmt[] = KERN_DEFAULT "ALSA %s:%d %pV";
+ #endif
++#endif
+
+ #ifdef CONFIG_SND_DEBUG
+ if (debug < level)
+@@ -76,6 +103,11 @@
+ #endif
+
+ va_start(args, format);
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 36)
++ if (print_snd_pfx(level, path, line, format))
++ format += 3; /* skip the printk level-prefix */
++ vprintk(format, args);
++#else
+ #ifdef CONFIG_SND_VERBOSE_PRINTK
+ vaf.fmt = format;
+ vaf.va = &args;
+@@ -89,6 +121,7 @@
+ vprintk(format, args);
+ #endif
+ va_end(args);
++#endif /* < 2.6.36 */
+ }
+ EXPORT_SYMBOL_GPL(__snd_printk);
+ #endif
+@@ -138,9 +171,42 @@
const struct snd_pci_quirk *
snd_pci_quirk_lookup(struct pci_dev *pci, const struct snd_pci_quirk *list)
{