diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-10-10 16:39:19 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-10-10 16:39:19 -0400 |
commit | 48fb2688aa67baba373531cc4ed2d9e695983c3f (patch) | |
tree | 9382e5175e43b914fd06bb778cc6f37a4967ab9d /drivers/ide/ide-iops.c | |
parent | 4dde4492d850a4c9bcaa92e5bd7f4eebe3e2f5ab (diff) |
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>
Diffstat (limited to 'drivers/ide/ide-iops.c')
-rw-r--r-- | drivers/ide/ide-iops.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c index 01b1943b315e..95495e4219ff 100644 --- a/drivers/ide/ide-iops.c +++ b/drivers/ide/ide-iops.c | |||
@@ -404,26 +404,10 @@ void ide_fix_driveid(u16 *id) | |||
404 | { | 404 | { |
405 | #ifndef __LITTLE_ENDIAN | 405 | #ifndef __LITTLE_ENDIAN |
406 | # ifdef __BIG_ENDIAN | 406 | # ifdef __BIG_ENDIAN |
407 | struct hd_driveid *driveid = (struct hd_driveid *)id; | ||
408 | int i; | 407 | int i; |
409 | 408 | ||
410 | for (i = 0; i < 256; i++) { | 409 | for (i = 0; i < 256; i++) |
411 | /* these words are accessed as two 8-bit values */ | ||
412 | if (i == 47 || i == 49 || i == 51 || i == 52 || i == 59) | ||
413 | continue; | ||
414 | if (i == 60 || i == 61) /* ->lba_capacity is 32-bit */ | ||
415 | continue; | ||
416 | if (i == 98 || i == 99) /* ->spg is 32-bit */ | ||
417 | continue; | ||
418 | if (i > 99 && i < 104) /* ->lba_capacity_2 is 64-bit */ | ||
419 | continue; | ||
420 | |||
421 | id[i] = __le16_to_cpu(id[i]); | 410 | id[i] = __le16_to_cpu(id[i]); |
422 | } | ||
423 | |||
424 | driveid->lba_capacity = __le32_to_cpu(driveid->lba_capacity); | ||
425 | driveid->spg = __le32_to_cpu(driveid->spg); | ||
426 | driveid->lba_capacity_2 = __le64_to_cpu(driveid->lba_capacity_2); | ||
427 | # else | 411 | # else |
428 | # error "Please fix <asm/byteorder.h>" | 412 | # error "Please fix <asm/byteorder.h>" |
429 | # endif | 413 | # endif |
@@ -752,7 +736,7 @@ int ide_config_drive_speed(ide_drive_t *drive, u8 speed) | |||
752 | #endif | 736 | #endif |
753 | 737 | ||
754 | /* Skip setting PIO flow-control modes on pre-EIDE drives */ | 738 | /* Skip setting PIO flow-control modes on pre-EIDE drives */ |
755 | if ((speed & 0xf8) == XFER_PIO_0 && !(drive->driveid->capability & 8)) | 739 | if ((speed & 0xf8) == XFER_PIO_0 && ata_id_has_iordy(drive->id) == 0) |
756 | goto skip; | 740 | goto skip; |
757 | 741 | ||
758 | /* | 742 | /* |