aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/bus.h
diff options
context:
space:
mode:
authorAndriy Gapon <avg@FreeBSD.org>2019-06-27 15:51:50 +0000
committerAndriy Gapon <avg@FreeBSD.org>2019-06-27 15:51:50 +0000
commitf45e9414cfa62630c05dbe185b9fe099195a88aa (patch)
treeea7b4a262644607976d5c0b9157b343a7940cbde /sys/sys/bus.h
parent061b38cdccdb63311b9917fedd92cd4190010c67 (diff)
downloadsrc-f45e9414cfa62630c05dbe185b9fe099195a88aa.tar.gz
src-f45e9414cfa62630c05dbe185b9fe099195a88aa.zip
revert r349460, printf -> KASSERT in bus.h, until I can fix it
I tested only kernel builds naively assuming that sys/bus.h cannot affect userland builds. Pointyhat to: me
Notes
Notes: svn path=/head/; revision=349461
Diffstat (limited to 'sys/sys/bus.h')
-rw-r--r--sys/sys/bus.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/sys/sys/bus.h b/sys/sys/bus.h
index 915d6bc886db..9fb4a6d4c38e 100644
--- a/sys/sys/bus.h
+++ b/sys/sys/bus.h
@@ -35,7 +35,6 @@
#include <machine/_bus.h>
#include <sys/_bus_dma.h>
#include <sys/ioccom.h>
-#include <sys/systm.h>
/**
* @defgroup NEWBUS newbus - a generic framework for managing devices
@@ -814,9 +813,12 @@ static __inline type varp ## _get_ ## var(device_t dev) \
int e; \
e = BUS_READ_IVAR(device_get_parent(dev), dev, \
ivarp ## _IVAR_ ## ivar, &v); \
- KASSERT(e == 0, ("%s failed for %s on bus %s, error = %d", \
- __func__, device_get_nameunit(dev), \
- device_get_nameunit(device_get_parent(dev)), e)); \
+ if (e != 0) { \
+ device_printf(dev, "failed to read ivar " \
+ __XSTRING(ivarp ## _IVAR_ ## ivar) " on bus %s, " \
+ "error = %d\n", \
+ device_get_nameunit(device_get_parent(dev)), e); \
+ } \
return ((type) v); \
} \
\
@@ -826,9 +828,12 @@ static __inline void varp ## _set_ ## var(device_t dev, type t) \
int e; \
e = BUS_WRITE_IVAR(device_get_parent(dev), dev, \
ivarp ## _IVAR_ ## ivar, v); \
- KASSERT(e == 0, ("%s failed for %s on bus %s, error = %d", \
- __func__, device_get_nameunit(dev), \
- device_get_nameunit(device_get_parent(dev)), e)); \
+ if (e != 0) { \
+ device_printf(dev, "failed to write ivar " \
+ __XSTRING(ivarp ## _IVAR_ ## ivar) " on bus %s, " \
+ "error = %d\n", \
+ device_get_nameunit(device_get_parent(dev)), e); \
+ } \
}
/**