From owner-svn-src-all@freebsd.org Mon May 16 20:22:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E388B3D736; Mon, 16 May 2016 20:22:54 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D78B818CC; Mon, 16 May 2016 20:22:53 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4GKMrIL025868; Mon, 16 May 2016 20:22:53 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GKMque025867; Mon, 16 May 2016 20:22:52 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605162022.u4GKMque025867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 16 May 2016 20:22:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299975 - head/sys/dev/siba X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 20:22:54 -0000 Author: adrian Date: Mon May 16 20:22:52 2016 New Revision: 299975 URL: https://svnweb.freebsd.org/changeset/base/299975 Log: [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 Modified: head/sys/dev/siba/siba_core.c Modified: head/sys/dev/siba/siba_core.c ============================================================================== --- head/sys/dev/siba/siba_core.c Mon May 16 20:18:54 2016 (r299974) +++ head/sys/dev/siba/siba_core.c Mon May 16 20:22:52 2016 (r299975) @@ -34,6 +34,8 @@ __FBSDID("$FreeBSD$"); * the Sonics Silicon Backplane driver. */ +#include "opt_siba.h" + #include #include #include @@ -60,7 +62,6 @@ __FBSDID("$FreeBSD$"); #include #include -#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);