diff options
author | Ian Moffett <ian@osmora.org> | 2025-08-16 18:22:11 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-08-16 18:22:11 -0400 |
commit | 4386cfb6490025c4d0f464e31cf4a8d90f065a1b (patch) | |
tree | 686405238a3ba3f2ba38014f696e542bd5fedcd1 /sys | |
parent | 43cbfc8a9da11df74ce6c0e510f9b382a4e9292b (diff) |
kernel: ahci: Register drives with disk framework
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ic/ahci.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/dev/ic/ahci.c b/sys/dev/ic/ahci.c index cd27f6a..d994ef1 100644 --- a/sys/dev/ic/ahci.c +++ b/sys/dev/ic/ahci.c @@ -36,6 +36,7 @@ #include <sys/param.h> #include <sys/bitops.h> #include <sys/mmio.h> +#include <sys/disk.h> #include <dev/pci/pci.h> #include <dev/pci/pciregs.h> #include <dev/timer.h> @@ -834,6 +835,12 @@ ahci_register(struct hba_device *dp, struct ahci_hba *hba) return error; } + snprintf(devname, sizeof(devname), "SATA drive %d", dp->dev); + error = disk_add(devname, dp->dev, &ahci_bdevsw, 0); + if (error < 0) { + pr_error("failed to add disk \"%s\"\n", devname); + return 1; + } return 0; } |