diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-10-10 16:39:20 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-10-10 16:39:20 -0400 |
commit | f41891c134ccdd07583ebd8d4af7fed883375672 (patch) | |
tree | 46b4d3311c3500f235b74eeb83916918a2a9832a /drivers/ide/ide-disk.c | |
parent | 8a089c6679a9f1c0a00b7e08554e90b507ec527a (diff) |
ide-disk: use ata_id_hpa_enabled()
idedisk_supports_hpa() -> ata_id_hpa_enabled().
The latter one also checks validity of words 82 & 85.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-disk.c')
-rw-r--r-- | drivers/ide/ide-disk.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index 696658d504db..40253c51ace4 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c | |||
@@ -386,17 +386,6 @@ static unsigned long long sectors_to_MB(unsigned long long n) | |||
386 | } | 386 | } |
387 | 387 | ||
388 | /* | 388 | /* |
389 | * Bits 10 of command_set_1 and cfs_enable_1 must be equal, | ||
390 | * so on non-buggy drives we need test only one. | ||
391 | * However, we should also check whether these fields are valid. | ||
392 | */ | ||
393 | static inline int idedisk_supports_hpa(const u16 *id) | ||
394 | { | ||
395 | return (id[ATA_ID_COMMAND_SET_1] & 0x0400) && | ||
396 | (id[ATA_ID_CFS_ENABLE_1] & 0x0400); | ||
397 | } | ||
398 | |||
399 | /* | ||
400 | * The same here. | 389 | * The same here. |
401 | */ | 390 | */ |
402 | static inline int idedisk_supports_lba48(const u16 *id) | 391 | static inline int idedisk_supports_lba48(const u16 *id) |
@@ -461,7 +450,7 @@ static void init_idedisk_capacity(ide_drive_t *drive) | |||
461 | * If this drive supports the Host Protected Area feature set, | 450 | * If this drive supports the Host Protected Area feature set, |
462 | * then we may need to change our opinion about the drive's capacity. | 451 | * then we may need to change our opinion about the drive's capacity. |
463 | */ | 452 | */ |
464 | int hpa = idedisk_supports_hpa(id); | 453 | int hpa = ata_id_hpa_enabled(id); |
465 | 454 | ||
466 | if (idedisk_supports_lba48(id)) { | 455 | if (idedisk_supports_lba48(id)) { |
467 | /* drive speaks 48-bit LBA */ | 456 | /* drive speaks 48-bit LBA */ |
@@ -939,7 +928,7 @@ static int ide_disk_probe(ide_drive_t *drive); | |||
939 | */ | 928 | */ |
940 | static void ide_disk_resume(ide_drive_t *drive) | 929 | static void ide_disk_resume(ide_drive_t *drive) |
941 | { | 930 | { |
942 | if (idedisk_supports_hpa(drive->id)) | 931 | if (ata_id_hpa_enabled(drive->id)) |
943 | init_idedisk_capacity(drive); | 932 | init_idedisk_capacity(drive); |
944 | } | 933 | } |
945 | 934 | ||