diff --git a/sys/dev/ata/ata-pci.c b/sys/dev/ata/ata-pci.c index 4e12bc8df827..db6f97dfe0db 100644 --- a/sys/dev/ata/ata-pci.c +++ b/sys/dev/ata/ata-pci.c @@ -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;