aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ahci/ahci.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/ahci/ahci.c')
-rw-r--r--sys/dev/ahci/ahci.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/dev/ahci/ahci.c b/sys/dev/ahci/ahci.c
index 4b13ae3068d5..12e6ee8102da 100644
--- a/sys/dev/ahci/ahci.c
+++ b/sys/dev/ahci/ahci.c
@@ -376,7 +376,10 @@ ahci_attach(device_t dev)
device_set_ivars(child, (void *)(intptr_t)(unit | AHCI_REMAPPED_UNIT));
}
- if (ctlr->caps & AHCI_CAP_EMS) {
+ int em = (ctlr->caps & AHCI_CAP_EMS) != 0;
+ resource_int_value(device_get_name(dev), device_get_unit(dev),
+ "em", &em);
+ if (em) {
child = device_add_child(dev, "ahciem", -1);
if (child == NULL)
device_printf(dev, "failed to add enclosure device\n");
@@ -602,6 +605,8 @@ ahci_alloc_resource(device_t dev, device_t child, int type, int *rid,
} else if (!is_em) {
offset = AHCI_OFFSET + (unit << 7);
size = 128;
+ } else if ((ctlr->caps & AHCI_CAP_EMS) == 0) {
+ break;
} else if (*rid == 0) {
offset = AHCI_EM_CTL;
size = 4;