diff options
author | Tang Yuantian <B29983@freescale.com> | 2011-10-03 12:18:41 -0700 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2011-10-09 17:57:54 -0500 |
commit | 007a28d54de7ff5794b14854f12cda6e49ec1122 (patch) | |
tree | b2fd57ecb88e36f60ad7cb550225de97d5a4786a /drivers/block/fsl_sata.c | |
parent | 8af3d22db9aaf1d05cd971940e577d420e9eae6f (diff) | |
download | u-boot-imx-007a28d54de7ff5794b14854f12cda6e49ec1122.zip u-boot-imx-007a28d54de7ff5794b14854f12cda6e49ec1122.tar.gz u-boot-imx-007a28d54de7ff5794b14854f12cda6e49ec1122.tar.bz2 |
fsl_sata: Fix compile error when CONFIG_LBA48 is not defined
If CONFIG_LBA48 is not defined, the element lba48 of struct sata_dev_desc
is not avaible, and can't be used.
Signed-off-by: Tang Yuantian <b29983@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'drivers/block/fsl_sata.c')
-rw-r--r-- | drivers/block/fsl_sata.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/block/fsl_sata.c b/drivers/block/fsl_sata.c index 4b97a0e..b101bd7 100644 --- a/drivers/block/fsl_sata.c +++ b/drivers/block/fsl_sata.c @@ -700,7 +700,7 @@ u32 fsl_sata_rw_ncq_cmd(int dev, u32 start, u32 blkcnt, u8 *buffer, int is_write int ncq_channel; u64 block; - if (sata_dev_desc[dev].lba48 != 1) { + if (sata->lba48 != 1) { printf("execute FPDMA command on non-LBA48 hard disk\n\r"); return -1; } @@ -854,8 +854,9 @@ u32 ata_low_level_rw_lba28(int dev, u32 blknr, u32 blkcnt, void *buffer, int is_ ulong sata_read(int dev, u32 blknr, u32 blkcnt, void *buffer) { u32 rc; + fsl_sata_t *sata = (fsl_sata_t *)sata_dev_desc[dev].priv; - if (sata_dev_desc[dev].lba48) + if (sata->lba48) rc = ata_low_level_rw_lba48(dev, blknr, blkcnt, buffer, READ_CMD); else rc = ata_low_level_rw_lba28(dev, blknr, blkcnt, buffer, READ_CMD); @@ -865,8 +866,9 @@ ulong sata_read(int dev, u32 blknr, u32 blkcnt, void *buffer) ulong sata_write(int dev, u32 blknr, u32 blkcnt, void *buffer) { u32 rc; + fsl_sata_t *sata = (fsl_sata_t *)sata_dev_desc[dev].priv; - if (sata_dev_desc[dev].lba48) { + if (sata->lba48) { rc = ata_low_level_rw_lba48(dev, blknr, blkcnt, buffer, WRITE_CMD); if (fsl_sata_get_wcache(dev) && fsl_sata_get_flush_ext(dev)) fsl_sata_flush_cache_ext(dev); @@ -916,11 +918,14 @@ int scan_sata(int dev) n_sectors = ata_id_n_sectors(id); sata_dev_desc[dev].lba = (u32)n_sectors; +#ifdef CONFIG_LBA48 /* Check if support LBA48 */ if (ata_id_has_lba48(id)) { - sata_dev_desc[dev].lba48 = 1; + sata->lba48 = 1; debug("Device support LBA48\n\r"); - } + } else + debug("Device supports LBA28\n\r"); +#endif /* Get the NCQ queue depth from device */ sata->queue_depth = ata_id_queue_depth(id); |