Merge branch 'u-boot-stm32_20190827' of https://gitlab.denx.de/u-boot/custodians...
[oweals/u-boot.git] / include / linux / compat.h
index 59937de960a37819d8de2057de9e25b55363ebd7..d0f51baab407b67d8c7010f8c325bc2d81fc792e 100644 (file)
@@ -15,7 +15,22 @@ struct p_current{
 
 extern struct p_current *current;
 
-#define ndelay(x)      udelay(1)
+/* avoid conflict with <dm/device.h> */
+#ifdef dev_dbg
+#undef dev_dbg
+#endif
+#ifdef dev_vdbg
+#undef dev_vdbg
+#endif
+#ifdef dev_info
+#undef dev_info
+#endif
+#ifdef dev_err
+#undef dev_err
+#endif
+#ifdef dev_warn
+#undef dev_warn
+#endif
 
 #define dev_dbg(dev, fmt, args...)             \
        debug(fmt, ##args)
@@ -25,17 +40,27 @@ extern struct p_current *current;
        printf(fmt, ##args)
 #define dev_err(dev, fmt, args...)             \
        printf(fmt, ##args)
-#define printk printf
-#define printk_once    printf
-
-#define KERN_EMERG
-#define KERN_ALERT
-#define KERN_CRIT
-#define KERN_ERR
-#define KERN_WARNING
-#define KERN_NOTICE
-#define KERN_INFO
-#define KERN_DEBUG
+#define dev_warn(dev, fmt, args...)            \
+       printf(fmt, ##args)
+
+#define netdev_emerg(dev, fmt, args...)                \
+       printf(fmt, ##args)
+#define netdev_alert(dev, fmt, args...)                \
+       printf(fmt, ##args)
+#define netdev_crit(dev, fmt, args...)         \
+       printf(fmt, ##args)
+#define netdev_err(dev, fmt, args...)          \
+       printf(fmt, ##args)
+#define netdev_warn(dev, fmt, args...)         \
+       printf(fmt, ##args)
+#define netdev_notice(dev, fmt, args...)       \
+       printf(fmt, ##args)
+#define netdev_info(dev, fmt, args...)         \
+       printf(fmt, ##args)
+#define netdev_dbg(dev, fmt, args...)          \
+       debug(fmt, ##args)
+#define netdev_vdbg(dev, fmt, args...)         \
+       debug(fmt, ##args)
 
 #define GFP_ATOMIC ((gfp_t) 0)
 #define GFP_KERNEL ((gfp_t) 0)
@@ -98,17 +123,6 @@ static inline void kmem_cache_destroy(struct kmem_cache *cachep)
 
 #define KERNEL_VERSION(a,b,c)  (((a) << 16) + ((b) << 8) + (c))
 
-#ifndef BUG
-#define BUG() do { \
-       printf("U-Boot BUG at %s:%d!\n", __FILE__, __LINE__); \
-} while (0)
-
-#define BUG_ON(condition) do { if (condition) BUG(); } while(0)
-#endif /* BUG */
-
-#define WARN_ON(x) if (x) {printf("WARNING in %s line %d\n" \
-                                 , __FILE__, __LINE__); }
-
 #define PAGE_SIZE      4096
 
 /* drivers/char/random.c */
@@ -130,12 +144,6 @@ static inline void led_trigger_unregister_simple(struct led_trigger *trigger) {}
 static inline void led_trigger_event(struct led_trigger *trigger,
                                        enum led_brightness event) {}
 
-/* include/linux/log2.h */
-static inline int is_power_of_2(unsigned long n)
-{
-       return (n != 0 && ((n & (n - 1)) == 0));
-}
-
 /* uapi/linux/limits.h */
 #define XATTR_LIST_MAX 65536   /* size of extended attribute namelist (64k) */
 
@@ -155,8 +163,6 @@ typedef unsigned long sector_t;
 typedef unsigned long blkcnt_t;
 #endif
 
-#define ENOTSUPP       524     /* Operation is not supported */
-
 /* module */
 #define THIS_MODULE            0
 #define try_module_get(...)    1
@@ -206,7 +212,6 @@ typedef unsigned long blkcnt_t;
 #define init_waitqueue_head(...)       do { } while (0)
 #define wait_event_interruptible(...)  0
 #define wake_up_interruptible(...)     do { } while (0)
-#define print_hex_dump(...)            do { } while (0)
 #define dump_stack(...)                        do { } while (0)
 
 #define task_pid_nr(x)                 0