Patchwork [U-Boot,v3,3/5] linux/compat.h: move dev_err, dev_info and dev_dbg from usb driver to compat.h

login
register
mail settings
Submitter Wu, Josh
Date July 3, 2013, 3:11 a.m.
Message ID <1372821109-22007-4-git-send-email-josh.wu@atmel.com>
Download mbox | patch
Permalink /patch/256535/
State Accepted
Delegated to: Andreas Bießmann
Headers show

Comments

Wu, Josh - July 3, 2013, 3:11 a.m.
Since kernel code current use many dev_xxx() instead of using printk. To
compatible, move those dev_xxx from usb driver to linux/compat.h. Then all
driver code can use dev_err, dev_info and dev_vdbg.

This patch also removed duplicated macro definitions in usb driver.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
---
 drivers/usb/musb-new/linux-compat.h |   16 ----------------
 include/linux/compat.h              |    8 ++++++++
 2 files changed, 8 insertions(+), 16 deletions(-)
Andreas Bießmann - Aug. 22, 2013, 3 p.m.
Dear Josh Wu,

Josh Wu <Josh.wu@atmel.com> writes:
>Since kernel code current use many dev_xxx() instead of using printk. To
>compatible, move those dev_xxx from usb driver to linux/compat.h. Then all
>driver code can use dev_err, dev_info and dev_vdbg.
>
>This patch also removed duplicated macro definitions in usb driver.
>
>Signed-off-by: Josh Wu <josh.wu@atmel.com>
>Acked-by: Scott Wood <scottwood@freescale.com>
>---
>drivers/usb/musb-new/linux-compat.h |   16 ----------------
> include/linux/compat.h              |    8 ++++++++
> 2 files changed, 8 insertions(+), 16 deletions(-)

applied to u-boot-atmel/master, thanks!

Best regards,
Andreas Bießmann

Patch

diff --git a/drivers/usb/musb-new/linux-compat.h b/drivers/usb/musb-new/linux-compat.h
index 72c8c2b..d7a5663 100644
--- a/drivers/usb/musb-new/linux-compat.h
+++ b/drivers/usb/musb-new/linux-compat.h
@@ -39,15 +39,6 @@  typedef unsigned long dmaaddr_t;
 #define cpu_relax() do {} while (0)
 
 #define pr_debug(fmt, args...) debug(fmt, ##args)
-#define dev_dbg(dev, fmt, args...)		\
-	debug(fmt, ##args)
-#define dev_vdbg(dev, fmt, args...)		\
-	debug(fmt, ##args)
-#define dev_info(dev, fmt, args...)		\
-	printf(fmt, ##args)
-#define dev_err(dev, fmt, args...)		\
-	printf(fmt, ##args)
-#define printk printf
 
 #define WARN(condition, fmt, args...) ({	\
 	int ret_warn = !!condition;		\
@@ -55,13 +46,6 @@  typedef unsigned long dmaaddr_t;
 		printf(fmt, ##args);		\
 	ret_warn; })
 
-#define KERN_DEBUG
-#define KERN_NOTICE
-#define KERN_WARNING
-#define KERN_ERR
-
-#define kfree(ptr) free(ptr)
-
 #define pm_runtime_get_sync(dev) do {} while (0)
 #define pm_runtime_put(dev) do {} while (0)
 #define pm_runtime_put_sync(dev) do {} while (0)
diff --git a/include/linux/compat.h b/include/linux/compat.h
index e1338bf..3fdfb39 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -3,6 +3,14 @@ 
 
 #define ndelay(x)	udelay(1)
 
+#define dev_dbg(dev, fmt, args...)		\
+	debug(fmt, ##args)
+#define dev_vdbg(dev, fmt, args...)		\
+	debug(fmt, ##args)
+#define dev_info(dev, fmt, args...)		\
+	printf(fmt, ##args)
+#define dev_err(dev, fmt, args...)		\
+	printf(fmt, ##args)
 #define printk	printf
 
 #define KERN_EMERG