Use devclass_find_free_unit() in ata_pci_add_child() because no more

implicit auto-scanning up present in device_add_child(). Functionally it is
fully equivalent to old code.
This commit is contained in:
Andrey A. Chernov 2001-11-01 05:21:49 +00:00
parent 3eadb99fd7
commit f21d113aa0

View File

@ -271,7 +271,8 @@ ata_pci_add_child(device_t dev, int unit)
return ENOMEM;
}
else {
if (!(child = device_add_child(dev, "ata", 2)))
if (!(child = device_add_child(dev, "ata",
devclass_find_free_unit(devclass_find("ata"), 2))))
return ENOMEM;
}
return 0;