From abb09a012de9de25728afc1927e61e94f36c19e4 Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Mon, 11 Nov 2013 13:42:47 -0600 Subject: [PATCH] dahdi: Work around missing KBUILD_MODNAME Some older versions of Kbuild will not pass KBUILD_MODNAME to a compilation unit that is linked to multiple drivers. This change works around this issue by globally modifing dev_dbg in this case. Signed-off-by: Shaun Ruffell --- include/dahdi/kernel.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/dahdi/kernel.h b/include/dahdi/kernel.h index 8f3dc76..2e8a9a3 100644 --- a/include/dahdi/kernel.h +++ b/include/dahdi/kernel.h @@ -1571,6 +1571,17 @@ struct mutex { printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) #endif +/* If KBUILD_MODNAME is not defined in a compilation unit, then the dev_dbg + * macro will not work properly. */ +#ifndef KBUILD_MODNAME + #undef dev_dbg + #ifdef DEBUG + #define dev_dbg dev_info + #else + #define dev_dbg(...) do { } while (0) + #endif +#endif + /* The dbg_* ones use a magical variable 'debug' and the user should be * aware of that. */