From 25afb89b1c410451fcfc5cbeed8535fcc660dd66 Mon Sep 17 00:00:00 2001 From: Doug Rabson Date: Tue, 12 Oct 1999 21:35:51 +0000 Subject: * Add struct resource_list* argument to resource_list_alloc and resource_list_release. This removes the dependancy on the layout of ivars. * Move set_resource, get_resource and delete_resource from isa_if.m to bus_if.m. * Simplify driver code by providing wrappers to those methods: bus_set_resource(dev, type, rid, start, count); bus_get_resource(dev, type, rid, startp, countp); bus_get_resource_start(dev, type, rid); bus_get_resource_count(dev, type, rid); bus_delete_resource(dev, type, rid); * Delete isa_get_rsrc and use bus_get_resource_start instead. * Fix a stupid typo in isa_alloc_resource reported by Takahashi Yoshihiro . * Print a diagnostic message if we can't assign resources to a PnP device. * Change device_print_prettyname() so that it doesn't print "(no driver assigned)-1" for anonymous devices. --- sys/dev/aha/aha_isa.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'sys/dev/aha') diff --git a/sys/dev/aha/aha_isa.c b/sys/dev/aha/aha_isa.c index cb55409bcb950..0720aa7bd425a 100644 --- a/sys/dev/aha/aha_isa.c +++ b/sys/dev/aha/aha_isa.c @@ -83,8 +83,8 @@ aha_isa_probe(device_t dev) if (ISA_PNP_PROBE(device_get_parent(dev), dev, aha_ids) == ENXIO) return (ENXIO); - error = ISA_GET_RESOURCE(device_get_parent(dev), dev, SYS_RES_IOPORT, - 0, &port_start, &port_count); + error = bus_get_resource(dev, SYS_RES_IOPORT, 0, + &port_start, &port_count); if (error != 0) port_start = 0; @@ -111,8 +111,8 @@ aha_isa_probe(device_t dev) */ if (aha_check_probed_iop(ioport) != 0) continue; - error = ISA_SET_RESOURCE(device_get_parent(dev), dev, - SYS_RES_IOPORT, 0, ioport, AHA_NREGS); + error = bus_set_resource(dev, SYS_RES_IOPORT, 0, + ioport, AHA_NREGS); if (error) return error; @@ -179,14 +179,12 @@ aha_isa_probe(device_t dev) "Failing probe\n", ioport); return (ENXIO); } - error = ISA_SET_RESOURCE(device_get_parent(dev), dev, - SYS_RES_DRQ, 0, drq, 1); + error = bus_set_resource(dev, SYS_RES_DRQ, 0, drq, 1); if (error) return error; irq = ffs(config_data.irq) + 8; - error = ISA_SET_RESOURCE(device_get_parent(dev), dev, - SYS_RES_IRQ, 0, irq, 1); + error = bus_set_resource(dev, SYS_RES_IRQ, 0, irq, 1); if (error) return error; -- cgit v1.3