port_regs[HBA_RPxCMD] |= HBA_PxCMD_ST;
if (!ahci_init_device(port)) {
- kprintf(KERROR "init fail: 0x%x@p%d\n", port->regs[HBA_RPxSIG], i);
+ kprintf(KERROR "init fail: 0x%x@p%d", port->regs[HBA_RPxSIG], i);
continue;
}
struct hba_device* hbadev = port->device;
- kprintf(KINFO "sata%d: %s, blk_size=%d, blk=0..%d\n",
+ kprintf(KINFO "sata%d: %s, blk_size=%d, blk=0..%d",
i,
hbadev->model,
hbadev->block_size,
ahci_register_device(hbadev);
}
- dev->underlay = ahci_drv;
+ pci_bind_instance(ahci_dev, ahci_drv);
return 0;
}
static struct pci_device_def ahcidef = {
.dev_class = AHCI_HBA_CLASS,
- .ident_mask = 0x0,
+ .ident_mask = PCI_MATCH_ANY,
.devdef = { .class = DEVCLASS(DEVIF_PCI, DEVFN_STORAGE, DEV_SATA),
.name = "Serial ATA Controller",
- .init_for = ahci_driver_init }
+ .bind = ahci_driver_init }
};
-EXPORT_DEVICE(ahci, &ahcidef.devdef, load_pci_probe);
\ No newline at end of file
+EXPORT_PCI_DEVICE(ahci, &ahcidef);
\ No newline at end of file