mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-10 15:19:51 +00:00
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>
This commit is contained in:
parent
8a089c6679
commit
f41891c134
@ -385,17 +385,6 @@ static unsigned long long sectors_to_MB(unsigned long long n)
|
|||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Bits 10 of command_set_1 and cfs_enable_1 must be equal,
|
|
||||||
* so on non-buggy drives we need test only one.
|
|
||||||
* However, we should also check whether these fields are valid.
|
|
||||||
*/
|
|
||||||
static inline int idedisk_supports_hpa(const u16 *id)
|
|
||||||
{
|
|
||||||
return (id[ATA_ID_COMMAND_SET_1] & 0x0400) &&
|
|
||||||
(id[ATA_ID_CFS_ENABLE_1] & 0x0400);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The same here.
|
* The same here.
|
||||||
*/
|
*/
|
||||||
@ -461,7 +450,7 @@ static void init_idedisk_capacity(ide_drive_t *drive)
|
|||||||
* If this drive supports the Host Protected Area feature set,
|
* If this drive supports the Host Protected Area feature set,
|
||||||
* then we may need to change our opinion about the drive's capacity.
|
* then we may need to change our opinion about the drive's capacity.
|
||||||
*/
|
*/
|
||||||
int hpa = idedisk_supports_hpa(id);
|
int hpa = ata_id_hpa_enabled(id);
|
||||||
|
|
||||||
if (idedisk_supports_lba48(id)) {
|
if (idedisk_supports_lba48(id)) {
|
||||||
/* drive speaks 48-bit LBA */
|
/* drive speaks 48-bit LBA */
|
||||||
@ -939,7 +928,7 @@ static int ide_disk_probe(ide_drive_t *drive);
|
|||||||
*/
|
*/
|
||||||
static void ide_disk_resume(ide_drive_t *drive)
|
static void ide_disk_resume(ide_drive_t *drive)
|
||||||
{
|
{
|
||||||
if (idedisk_supports_hpa(drive->id))
|
if (ata_id_hpa_enabled(drive->id))
|
||||||
init_idedisk_capacity(drive);
|
init_idedisk_capacity(drive);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user