diff --git a/sys/dev/ata/ata-chipset.c b/sys/dev/ata/ata-chipset.c index a880c738bdef..a242c283827b 100644 --- a/sys/dev/ata/ata-chipset.c +++ b/sys/dev/ata/ata-chipset.c @@ -3387,8 +3387,9 @@ ata_via_allocate(device_t dev) ctlr->r_type2 = SYS_RES_IOPORT; ctlr->r_rid2 = PCIR_BAR(5); - if (!(ctlr->r_res2 = bus_alloc_resource_any(dev, ctlr->r_type2, - &ctlr->r_rid2, RF_ACTIVE))) + if (!(ctlr->r_res2 = bus_alloc_resource_any(device_get_parent(dev), + ctlr->r_type2, &ctlr->r_rid2, + RF_ACTIVE))) return ENXIO; /* setup the usual register normal pci style */ diff --git a/sys/dev/ata/ata-pci.c b/sys/dev/ata/ata-pci.c index fbc82b73b22d..ebe8c5ba13cb 100644 --- a/sys/dev/ata/ata-pci.c +++ b/sys/dev/ata/ata-pci.c @@ -275,7 +275,6 @@ ata_pci_alloc_resource(device_t dev, device_t child, int type, int *rid, break; } } - if (type == SYS_RES_IRQ && *rid == ATA_IRQ_RID) { if (ata_legacy(dev)) { #ifdef __alpha__ @@ -290,7 +289,6 @@ ata_pci_alloc_resource(device_t dev, device_t child, int type, int *rid, else res = controller->r_irq; } - return res; }