summaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2011-04-07 17:17:42 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2011-05-06 08:36:04 +0200
commitc1bcb052ddf55c9181e0ce65962a793584d9154e (patch)
tree2115ee615a47a0fdf4717d35cb3b4ffe78cd2de3 /drivers/ata
parent0f16a03b00e3762069c2e227ad1fcf618a4c43a2 (diff)
downloadbarebox-c1bcb052ddf55c9181e0ce65962a793584d9154e.tar.gz
barebox-c1bcb052ddf55c9181e0ce65962a793584d9154e.tar.xz
ata: guessing disk sizes is only needed on X86
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/disk_drive.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/ata/disk_drive.c b/drivers/ata/disk_drive.c
index f526b1e102..23837691da 100644
--- a/drivers/ata/disk_drive.c
+++ b/drivers/ata/disk_drive.c
@@ -60,6 +60,7 @@ struct partition_entry {
* @param table partition table
* @return size in sectors
*/
+#ifdef CONFIG_ATA_BIOS
static unsigned long disk_guess_size(struct device_d *dev, struct partition_entry *table)
{
int part_order[4] = {0, 1, 2, 3};
@@ -83,6 +84,7 @@ static unsigned long disk_guess_size(struct device_d *dev, struct partition_entr
#endif
return size;
}
+#endif
/**
* Register partitions found on the drive
@@ -186,6 +188,7 @@ static int disk_probe(struct device_d *dev)
#endif
atablk->blk.cdev.name = asprintf("disk%d", dev->id);
+#ifdef CONFIG_ATA_BIOS
/* On x86, BIOS based disks are coming without a valid .size field */
if (dev->size == 0) {
/* guess the size of this drive if not otherwise given */
@@ -193,7 +196,7 @@ static int disk_probe(struct device_d *dev)
(struct partition_entry*)&sector[446]) * SECTOR_SIZE;
dev_info(dev, "Drive size guessed to %u kiB\n", dev->size / 1024);
}
-
+#endif
atablk->blk.num_blocks = dev->size / SECTOR_SIZE;
atablk->blk.ops = &ataops;
atablk->blk.blockbits = 9;