From: Bin Meng Date: Thu, 26 Jul 2018 10:15:58 +0000 (-0700) Subject: linux/compat.h: Add netdev_### log macros X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=b06d76f9ae2eae389ddaa74abeee7987bdf1b9d4;p=project%2Fbcm63xx%2Fu-boot.git linux/compat.h: Add netdev_### log macros Currently there are two ethernet drivers (mvneta.c and mvpp2.c) that has netdev_### (eg: netdev_dbg) log macros defined in its own driver file. This adds these log macros in a common place linux/compat.h. Signed-off-by: Bin Meng Acked-by: Joe Hershberger --- diff --git a/drivers/net/mvneta.c b/drivers/net/mvneta.c index ab697b9bc7..8cb04b52d7 100644 --- a/drivers/net/mvneta.c +++ b/drivers/net/mvneta.c @@ -34,14 +34,6 @@ DECLARE_GLOBAL_DATA_PTR; # error Marvell mvneta requires PHYLIB #endif -/* Some linux -> U-Boot compatibility stuff */ -#define netdev_err(dev, fmt, args...) \ - printf(fmt, ##args) -#define netdev_warn(dev, fmt, args...) \ - printf(fmt, ##args) -#define netdev_info(dev, fmt, args...) \ - printf(fmt, ##args) - #define CONFIG_NR_CPUS 1 #define ETH_HLEN 14 /* Total octets in header */ diff --git a/drivers/net/mvpp2.c b/drivers/net/mvpp2.c index 62c0c2be06..5c1f5fcd56 100644 --- a/drivers/net/mvpp2.c +++ b/drivers/net/mvpp2.c @@ -35,16 +35,6 @@ DECLARE_GLOBAL_DATA_PTR; -/* Some linux -> U-Boot compatibility stuff */ -#define netdev_err(dev, fmt, args...) \ - printf(fmt, ##args) -#define netdev_warn(dev, fmt, args...) \ - printf(fmt, ##args) -#define netdev_info(dev, fmt, args...) \ - printf(fmt, ##args) -#define netdev_dbg(dev, fmt, args...) \ - printf(fmt, ##args) - #define ETH_ALEN 6 /* Octets in one ethernet addr */ #define __verify_pcpu_ptr(ptr) \ diff --git a/include/linux/compat.h b/include/linux/compat.h index 6e3feb64d2..d0f51baab4 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h @@ -43,6 +43,25 @@ extern struct p_current *current; #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) #define GFP_NOFS ((gfp_t) 0)