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/pci/cs5530.c b/drivers/ide/pci/cs5530.c
index 774ff58..ef91e9d 100644
--- a/drivers/ide/pci/cs5530.c
+++ b/drivers/ide/pci/cs5530.c
@@ -88,7 +88,7 @@
 	if (mate->present == 0)
 		goto out;
 
-	if ((mate->driveid->capability & 1) && __ide_dma_bad_drive(mate) == 0) {
+	if (ata_id_has_dma(mateid) && __ide_dma_bad_drive(mate) == 0) {
 		if ((mateid[ATA_ID_FIELD_VALID] & 4) &&
 		    (mateid[ATA_ID_UDMA_MODES] & 7))
 			goto out;
diff --git a/drivers/ide/pci/it821x.c b/drivers/ide/pci/it821x.c
index 31d4e6a..ed24065 100644
--- a/drivers/ide/pci/it821x.c
+++ b/drivers/ide/pci/it821x.c
@@ -470,7 +470,7 @@
 			/* In raid mode the ident block is slightly buggy
 			   We need to set the bits so that the IDE layer knows
 			   LBA28. LBA48 and DMA ar valid */
-			drive->driveid->capability |= 3;      /* LBA28, DMA */
+			id[ATA_ID_CAPABILITY]    |= (3 << 8); /* LBA28, DMA */
 			id[ATA_ID_COMMAND_SET_2] |= 0x0400;   /* LBA48 valid */
 			id[ATA_ID_CFS_ENABLE_2]  |= 0x0400;   /* LBA48 on */
 			/* Reporting logic */
@@ -504,7 +504,7 @@
 		 * IDE core that DMA is supported (it821x hardware
 		 * takes care of DMA mode programming).
 		 */
-		if (drive->driveid->capability & 1) {
+		if (ata_id_has_dma(id)) {
 			id[ATA_ID_MWDMA_MODES] |= 0x0101;
 			drive->current_speed = XFER_MW_DMA_0;
 		}
diff --git a/drivers/ide/pci/pdc202xx_old.c b/drivers/ide/pci/pdc202xx_old.c
index 23e861b..5d4436f 100644
--- a/drivers/ide/pci/pdc202xx_old.c
+++ b/drivers/ide/pci/pdc202xx_old.c
@@ -86,7 +86,7 @@
 		 * Prefetch_EN / IORDY_EN / PA[3:0] bits of register A
 		 */
 		AP &= ~0x3f;
-		if (drive->driveid->capability & 4)
+		if (ata_id_iordy_disable(drive->id))
 			AP |= 0x20;	/* set IORDY_EN bit */
 		if (drive->media == ide_disk)
 			AP |= 0x10;	/* set Prefetch_EN bit */
diff --git a/drivers/ide/pci/sc1200.c b/drivers/ide/pci/sc1200.c
index 5c8367d..695cc97 100644
--- a/drivers/ide/pci/sc1200.c
+++ b/drivers/ide/pci/sc1200.c
@@ -111,7 +111,7 @@
 	if (mate->present == 0)
 		goto out;
 
-	if ((mate->driveid->capability & 1) && __ide_dma_bad_drive(mate) == 0) {
+	if (ata_id_has_dma(mateid) && __ide_dma_bad_drive(mate) == 0) {
 		if ((mateid[ATA_ID_FIELD_VALID] & 4) &&
 		    (mateid[ATA_ID_UDMA_MODES] & 7))
 			goto out;