summaryrefslogtreecommitdiffstats
path: root/sys/dev/ppbus/ppb_msq.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2008-10-21 18:30:10 +0000
committerjhb <jhb@FreeBSD.org>2008-10-21 18:30:10 +0000
commit03f7a1b892756cd78ff85f138ffdb94cd4216670 (patch)
tree7de1b18022c6338570a93ecf78a487c8a9820918 /sys/dev/ppbus/ppb_msq.c
parentddfa987b872f81817a11a48d9b97c719ef1e48d3 (diff)
downloadFreeBSD-src-03f7a1b892756cd78ff85f138ffdb94cd4216670.zip
FreeBSD-src-03f7a1b892756cd78ff85f138ffdb94cd4216670.tar.gz
Several cleanups to remove the need for explicit unit numbers and a few
other fixes: - Add pointers back to device_t objects in softc structures instead of storing the unit and using devclass_get_device(). - Add 'lpbb', 'pcf', 'pps', and 'vpo' child devices to every 'ppbus' device instead of just the first one. - Store softc pointers in si_drv1 of character devices instead of pulling the unit number from the minor number and using devclass_get_softc() and devclass_get_device(). - Store the LP_BYPASS flag in si_drv2 instead of encoding it in the minor number. - Destroy character devices for lpt(4) when detaching the device. - Use bus_print_child_footer() instead of duplicating it in ppbus_print_child() and fix ppbus_print_child()'s return value. - Remove unused AVM ivar from ppbus. - Don't store the 'mode' ivar in the ppbus ivars since we always fetch it from the parent anyway. - Try to detach all the child devices before deleting them in ppbus_detach(). - Use pause() instead of a tsleep() on a dummy address when polling the ppbus. - Use if_printf() and device_printf() instead of explicit names with unit numbers. Silence on: current@
Diffstat (limited to 'sys/dev/ppbus/ppb_msq.c')
-rw-r--r--sys/dev/ppbus/ppb_msq.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/ppbus/ppb_msq.c b/sys/dev/ppbus/ppb_msq.c
index 533ab5f..6b8e070 100644
--- a/sys/dev/ppbus/ppb_msq.c
+++ b/sys/dev/ppbus/ppb_msq.c
@@ -55,7 +55,7 @@ __FBSDID("$FreeBSD$");
static struct ppb_xfer *
mode2xfer(device_t bus, struct ppb_device *ppbdev, int opcode)
{
- int index, epp;
+ int index, epp, mode;
struct ppb_xfer *table;
switch (opcode) {
@@ -72,7 +72,8 @@ mode2xfer(device_t bus, struct ppb_device *ppbdev, int opcode)
}
/* retrieve the device operating mode */
- switch (ppb_get_mode(bus)) {
+ mode = ppb_get_mode(bus);
+ switch (mode) {
case PPB_COMPATIBLE:
index = COMPAT_MSQ;
break;
@@ -99,7 +100,7 @@ mode2xfer(device_t bus, struct ppb_device *ppbdev, int opcode)
index = ECP_MSQ;
break;
default:
- panic("%s: unknown mode (%d)", __func__, ppbdev->mode);
+ panic("%s: unknown mode (%d)", __func__, mode);
}
return (&table[index]);
OpenPOWER on IntegriCloud