mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
ide-disk: set_addressing() fixes
* Return -EIO if arg > 0 and LBA48 is unsupported. * No need to reset ->addressing. * Make ->addressing a single bit flag. Signed-off-by: Bartlomiej Zolnierkiewicz <[email protected]>
This commit is contained in:
parent
1ea1031cf9
commit
35c1375312
2 changed files with 6 additions and 7 deletions
|
|
@ -686,14 +686,13 @@ static int set_addressing(ide_drive_t *drive, int arg)
|
|||
if (arg < 0 || arg > 2)
|
||||
return -EINVAL;
|
||||
|
||||
drive->addressing = 0;
|
||||
|
||||
if (drive->hwif->host_flags & IDE_HFLAG_NO_LBA48)
|
||||
return 0;
|
||||
|
||||
if (ata_id_lba48_enabled(drive->id) == 0)
|
||||
if (arg && ((drive->hwif->host_flags & IDE_HFLAG_NO_LBA48) ||
|
||||
ata_id_lba48_enabled(drive->id) == 0))
|
||||
return -EIO;
|
||||
|
||||
if (arg == 2)
|
||||
arg = 0;
|
||||
|
||||
drive->addressing = arg;
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue