treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / drivers / net / ethernet / ibm / emac / debug.h
blobc09a46a329d900b583e6b5c8097db073ca001c36
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3 * drivers/net/ethernet/ibm/emac/debug.h
5 * Driver for PowerPC 4xx on-chip ethernet controller, debug print routines.
7 * Copyright 2007 Benjamin Herrenschmidt, IBM Corp.
8 * <benh@kernel.crashing.org>
10 * Based on the arch/ppc version of the driver:
12 * Copyright (c) 2004, 2005 Zultys Technologies
13 * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
15 #ifndef __IBM_NEWEMAC_DEBUG_H
16 #define __IBM_NEWEMAC_DEBUG_H
18 #include <linux/init.h>
20 #include "core.h"
22 #if defined(CONFIG_IBM_EMAC_DEBUG)
23 # define DBG_LEVEL 1
24 #else
25 # define DBG_LEVEL 0
26 #endif
28 #define EMAC_DBG(d, name, fmt, arg...) \
29 printk(KERN_DEBUG #name "%pOF: " fmt, d->ofdev->dev.of_node, ## arg)
31 #if DBG_LEVEL > 0
32 # define DBG(d,f,x...) EMAC_DBG(d, emac, f, ##x)
33 # define MAL_DBG(d,f,x...) EMAC_DBG(d, mal, f, ##x)
34 # define ZMII_DBG(d,f,x...) EMAC_DBG(d, zmii, f, ##x)
35 # define RGMII_DBG(d,f,x...) EMAC_DBG(d, rgmii, f, ##x)
36 # define NL "\n"
37 #else
38 # define DBG(f,x...) ((void)0)
39 # define MAL_DBG(d,f,x...) ((void)0)
40 # define ZMII_DBG(d,f,x...) ((void)0)
41 # define RGMII_DBG(d,f,x...) ((void)0)
42 #endif
43 #if DBG_LEVEL > 1
44 # define DBG2(d,f,x...) DBG(d,f, ##x)
45 # define MAL_DBG2(d,f,x...) MAL_DBG(d,f, ##x)
46 # define ZMII_DBG2(d,f,x...) ZMII_DBG(d,f, ##x)
47 # define RGMII_DBG2(d,f,x...) RGMII_DBG(d,f, ##x)
48 #else
49 # define DBG2(f,x...) ((void)0)
50 # define MAL_DBG2(d,f,x...) ((void)0)
51 # define ZMII_DBG2(d,f,x...) ((void)0)
52 # define RGMII_DBG2(d,f,x...) ((void)0)
53 #endif
55 #endif /* __IBM_NEWEMAC_DEBUG_H */