feat: support user-spcae pci rescan
[lunaix-os.git] / lunaix-os / hal / ahci / ahci.c
index 2aa37e504824531e9d8e0504c862a84094b04277..61ea95b511dc28a5d658bd9d19d951aae94e153b 100644 (file)
@@ -200,7 +200,7 @@ ahci_driver_init(struct device_def* def, struct device* dev)
         ahci_register_device(hbadev);
     }
 
         ahci_register_device(hbadev);
     }
 
-    dev->underlay = ahci_drv;
+    pci_bind_instance(ahci_dev, ahci_drv);
     return 0;
 }
 
     return 0;
 }
 
@@ -447,6 +447,6 @@ static struct pci_device_def ahcidef = {
     .ident_mask = PCI_MATCH_ANY,
     .devdef = { .class = DEVCLASS(DEVIF_PCI, DEVFN_STORAGE, DEV_SATA),
                 .name = "Serial ATA Controller",
     .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_PCI_DEVICE(ahci, &ahcidef);
\ No newline at end of file
 };
 EXPORT_PCI_DEVICE(ahci, &ahcidef);
\ No newline at end of file