summaryrefslogtreecommitdiffstats
path: root/sys/dev/siba
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2016-05-16 20:22:52 +0000
committeradrian <adrian@FreeBSD.org>2016-05-16 20:22:52 +0000
commit6f70537ffc0aebfe18e3d9e97319e7e5825be323 (patch)
treee5654759d1578ddce0d6b6ab5b0dfaa94aceba31 /sys/dev/siba
parent3a73906f1501c1cb34b5c5906192046fe844a6d4 (diff)
downloadFreeBSD-src-6f70537ffc0aebfe18e3d9e97319e7e5825be323.zip
FreeBSD-src-6f70537ffc0aebfe18e3d9e97319e7e5825be323.tar.gz
[siba] fix up debugging.
* unbreak non-debug builds - don't default to debugging SCAN; that was left-over from my testing. * include opt_siba.h, now that it's generated as appropriate. * stick the debug enum outside the debug block, just so it's there for any code that wants to set siba_debug for some reason (like say, my debugging muckup.) * make DPRINTF() use __VA_ARGS__ for formatting too, so it correctly handles printing w/ no args. * Make DPRINTF() use device_printf(). Sponsored by: Palm Springs
Diffstat (limited to 'sys/dev/siba')
-rw-r--r--sys/dev/siba/siba_core.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/sys/dev/siba/siba_core.c b/sys/dev/siba/siba_core.c
index 6b100f0..bbed7f6 100644
--- a/sys/dev/siba/siba_core.c
+++ b/sys/dev/siba/siba_core.c
@@ -34,6 +34,8 @@ __FBSDID("$FreeBSD$");
* the Sonics Silicon Backplane driver.
*/
+#include "opt_siba.h"
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/malloc.h>
@@ -60,7 +62,6 @@ __FBSDID("$FreeBSD$");
#include <dev/siba/sibareg.h>
#include <dev/siba/sibavar.h>
-#ifdef SIBA_DEBUG
enum {
SIBA_DEBUG_SCAN = 0x00000001, /* scan */
SIBA_DEBUG_PMU = 0x00000002, /* PMU */
@@ -70,13 +71,16 @@ enum {
SIBA_DEBUG_CORE = 0x00000020, /* handling cores */
SIBA_DEBUG_ANY = 0xffffffff
};
-#define DPRINTF(siba, m, fmt, ...) do { \
- if (siba->siba_debug & (m)) \
- printf(fmt, __VA_ARGS__); \
+
+#ifdef SIBA_DEBUG
+#define DPRINTF(siba, m, ...) do { \
+ if (siba->siba_debug & (m)) \
+ device_printf(siba->siba_dev, __VA_ARGS__); \
} while (0)
#else
-#define DPRINTF(siba, m, fmt, ...) do { (void) siba; } while (0)
+#define DPRINTF(siba, m, ...) do { (void) siba; } while (0)
#endif
+
#define N(a) (sizeof(a) / sizeof(a[0]))
static void siba_pci_gpio(struct siba_softc *, uint32_t, int);
@@ -184,8 +188,6 @@ siba_core_attach(struct siba_softc *siba)
siba->siba_ops = &siba_pci_ops;
- siba->siba_debug = SIBA_DEBUG_SCAN;
-
siba_pci_gpio(siba, SIBA_GPIO_CRYSTAL | SIBA_GPIO_PLL, 1);
siba_scan(siba);
OpenPOWER on IntegriCloud