ide: remove drive->driveid
* Factor out HDIO_[OBSOLETE,GET]_IDENTITY ioctls handling
to ide_get_identity_ioctl().
* Use temporary buffer in ide_get_identity_ioctl() instead
of accessing drive->id directly.
* Add ide_id_to_hd_driveid() inline to convert raw id into
struct hd_driveid format (needed on big-endian).
* Use ide_id_to_hd_driveid() in ide_get_identity_ioctl(),
cleanup ide_fix_driveid() and switch ide to use use raw id.
* Remove no longer needed drive->driveid.
This leaves us with 3 users of struct hd_driveid in tree:
- arch/um/drivers/ubd_kern.c
- drivers/block/xsysace.c
- drivers/usb/storage/isd200.c
While at it:
* Use ata_id_u{32,64}() and ata_id_has_{dma,lba,iordy}() macros.
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index 01b1943..95495e4 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -404,26 +404,10 @@
{
#ifndef __LITTLE_ENDIAN
# ifdef __BIG_ENDIAN
- struct hd_driveid *driveid = (struct hd_driveid *)id;
int i;
- for (i = 0; i < 256; i++) {
- /* these words are accessed as two 8-bit values */
- if (i == 47 || i == 49 || i == 51 || i == 52 || i == 59)
- continue;
- if (i == 60 || i == 61) /* ->lba_capacity is 32-bit */
- continue;
- if (i == 98 || i == 99) /* ->spg is 32-bit */
- continue;
- if (i > 99 && i < 104) /* ->lba_capacity_2 is 64-bit */
- continue;
-
+ for (i = 0; i < 256; i++)
id[i] = __le16_to_cpu(id[i]);
- }
-
- driveid->lba_capacity = __le32_to_cpu(driveid->lba_capacity);
- driveid->spg = __le32_to_cpu(driveid->spg);
- driveid->lba_capacity_2 = __le64_to_cpu(driveid->lba_capacity_2);
# else
# error "Please fix <asm/byteorder.h>"
# endif
@@ -752,7 +736,7 @@
#endif
/* Skip setting PIO flow-control modes on pre-EIDE drives */
- if ((speed & 0xf8) == XFER_PIO_0 && !(drive->driveid->capability & 8))
+ if ((speed & 0xf8) == XFER_PIO_0 && ata_id_has_iordy(drive->id) == 0)
goto skip;
/*