diff options
author | imp <imp@FreeBSD.org> | 2005-03-11 05:27:05 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2005-03-11 05:27:05 +0000 |
commit | 6881d62e6cf45269f81f003696e408f4241869e6 (patch) | |
tree | 504aec576c594117130ea7b3a91d161bd09c96c5 /sys/dev/cardbus | |
parent | 6440c7ec8697e0c96b2804e67e53fce155ba73d6 (diff) | |
download | FreeBSD-src-6881d62e6cf45269f81f003696e408f4241869e6.zip FreeBSD-src-6881d62e6cf45269f81f003696e408f4241869e6.tar.gz |
Revert changes of 1.49. Lots-a-people broke with it, for reasons
unknown (since my sony vaio didn't :-(.
Instead, fix the problem described by 1.49 in a different way: just
add the two calls I'd hoped I'd avoid in 1.49 by doing the (wrong)
gymnastics there. While 1.49 is a good direction to go in, each step
of the way should work :-(.
Diffstat (limited to 'sys/dev/cardbus')
-rw-r--r-- | sys/dev/cardbus/cardbus.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/dev/cardbus/cardbus.c b/sys/dev/cardbus/cardbus.c index 19974cd..aaabd08 100644 --- a/sys/dev/cardbus/cardbus.c +++ b/sys/dev/cardbus/cardbus.c @@ -471,10 +471,10 @@ cardbus_attach_card(device_t cbdev) } cardbus_pickup_maps(cbdev, child); cardbus_alloc_resources(cbdev, child); - pci_cfg_save(child, &dinfo->pci, 0); - pci_cfg_restore(child, &dinfo->pci); pci_print_verbose(&dinfo->pci); - if (device_probe_and_attach(child) == 0) + if (device_probe_and_attach(child) != 0) + cardbus_release_all_resources(cbdev, dinfo); + else cardattached++; } } @@ -545,8 +545,12 @@ cardbus_driver_added(device_t cbdev, driver_t *driver) continue; dinfo = device_get_ivars(dev); pci_print_verbose(&dinfo->pci); - pci_cfg_restore(dev, &dinfo->pci); - device_probe_and_attach(dev); + resource_list_init(&dinfo->pci.resources); + cardbus_do_cis(cbdev, dev); + cardbus_pickup_maps(cbdev, child); + cardbus_alloc_resources(cbdev, child); + if (device_probe_and_attach(dev) != 0) + cardbus_release_all_resources(cbdev, dinfo); } free(devlist, M_TEMP); } |