diff --git a/drivers/ahci.c b/drivers/ahci.c index a0330ca..bead535 100644 --- a/drivers/ahci.c +++ b/drivers/ahci.c @@ -282,7 +282,7 @@ static ssize_t ahci_block_write(struct block_device *bdev, struct sg_list *sg, s return ahci_rw_sg(bdev->priv, off, n, sg, true); } -struct sata_device *init_sata_port(struct ahci_host *host, u32 port, int type) +static struct sata_device *init_sata_port(struct ahci_host *host, u32 port, int type) { static struct block_ops ahci_block_ops = { .read = ahci_block_read, @@ -357,8 +357,12 @@ struct sata_device *init_sata_port(struct ahci_host *host, u32 port, int type) bdev->size = sdev->sector_count; bdev->block_size = sdev->sector_size; bdev->ops = ahci_block_ops; + bdev->disk.is_disk = true; strncpy(bdev->name, name, sizeof(bdev->name) - 1); + if (!packet) + block_check_partitions(bdev); + devfs_insert_device_blk(bdev->name, bdev, NULL); return sdev;