summaryrefslogtreecommitdiffstats
path: root/sys/dev/ppbus/vpoio.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/vpoio.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/vpoio.c')
-rw-r--r--sys/dev/ppbus/vpoio.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/dev/ppbus/vpoio.c b/sys/dev/ppbus/vpoio.c
index 7ff515f..2913495 100644
--- a/sys/dev/ppbus/vpoio.c
+++ b/sys/dev/ppbus/vpoio.c
@@ -399,8 +399,8 @@ vpoio_detect(struct vpoio_data *vpo)
if (!vpoio_in_disk_mode(vpo)) {
vpo->vpo_mode_found = VP0_MODE_UNDEFINED;
if (bootverbose)
- printf("vpo%d: can't connect to the drive\n",
- vpo->vpo_unit);
+ device_printf(vpo->vpo_dev,
+ "can't connect to the drive\n");
/* disconnect and release the bus */
ppb_MS_microseq(ppbus, vpo->vpo_dev, disconnect_microseq,
@@ -420,8 +420,8 @@ vpoio_detect(struct vpoio_data *vpo)
* may cause serious problem to the disk */
if (vpoio_in_disk_mode(vpo)) {
if (bootverbose)
- printf("vpo%d: can't disconnect from the drive\n",
- vpo->vpo_unit);
+ device_printf(vpo->vpo_dev,
+ "can't disconnect from the drive\n");
goto error;
}
@@ -617,17 +617,17 @@ vpoio_attach(struct vpoio_data *vpo)
case VP0_MODE_EPP:
ppb_MS_GET_init(ppbus, vpo->vpo_dev, epp17_instr_body);
ppb_MS_PUT_init(ppbus, vpo->vpo_dev, epp17_outstr_body);
- printf("vpo%d: EPP mode\n", vpo->vpo_unit);
+ device_printf(vpo->vpo_dev, "EPP mode\n");
break;
case VP0_MODE_PS2:
ppb_MS_GET_init(ppbus, vpo->vpo_dev, ps2_inbyte_submicroseq);
ppb_MS_PUT_init(ppbus, vpo->vpo_dev, spp_outbyte_submicroseq);
- printf("vpo%d: PS2 mode\n", vpo->vpo_unit);
+ device_printf(vpo->vpo_dev, "PS2 mode\n");
break;
case VP0_MODE_NIBBLE:
ppb_MS_GET_init(ppbus, vpo->vpo_dev, vpo->vpo_nibble_inbyte_msq);
ppb_MS_PUT_init(ppbus, vpo->vpo_dev, spp_outbyte_submicroseq);
- printf("vpo%d: NIBBLE mode\n", vpo->vpo_unit);
+ device_printf(vpo->vpo_dev, "NIBBLE mode\n");
break;
default:
panic("vpo: unknown mode %d", vpo->vpo_mode_found);
OpenPOWER on IntegriCloud