aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ide-scsi.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-10 16:39:19 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-10 16:39:19 -0400
commit4dde4492d850a4c9bcaa92e5bd7f4eebe3e2f5ab (patch)
treeee3be70390e4c617b44329edef0a05039f59c81a /drivers/scsi/ide-scsi.c
parent5b90e990928919ae411a68b865e8a6ecac09a603 (diff)
ide: make drive->id an union (take 2)
Make drive->id an unnamed union so id can be accessed either by using 'u16 *id' or 'struct hd_driveid *driveid'. Then convert all existing drive->id users accordingly (using 'u16 *id' when possible). This is an intermediate step to make ide 'struct hd_driveid'-free. While at it: - Add missing KERN_CONTs in it821x.c. - Use ATA_ID_WORDS and ATA_ID_*_LEN defines. - Remove unnecessary checks for drive->id. - s/drive_table/table/ in ide_in_drive_list(). - Cleanup ide_config_drive_speed() a bit. - s/drive1/dev1/ & s/drive0/dev0/ in ide_undecoded_slave(). v2: Fix typo in drivers/ide/ppc/pmac.c. (From Stephen Rothwell) There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/scsi/ide-scsi.c')
-rw-r--r--drivers/scsi/ide-scsi.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c
index 81c16cba5417..b1b506f31be8 100644
--- a/drivers/scsi/ide-scsi.c
+++ b/drivers/scsi/ide-scsi.c
@@ -452,7 +452,7 @@ static inline void idescsi_add_settings(ide_drive_t *drive) { ; }
452 */ 452 */
453static void idescsi_setup (ide_drive_t *drive, idescsi_scsi_t *scsi) 453static void idescsi_setup (ide_drive_t *drive, idescsi_scsi_t *scsi)
454{ 454{
455 if (drive->id && (drive->id->config & 0x0060) == 0x20) 455 if ((drive->id[ATA_ID_CONFIG] & 0x0060) == 0x20)
456 set_bit(IDE_AFLAG_DRQ_INTERRUPT, &drive->atapi_flags); 456 set_bit(IDE_AFLAG_DRQ_INTERRUPT, &drive->atapi_flags);
457 clear_bit(IDESCSI_SG_TRANSFORM, &scsi->transform); 457 clear_bit(IDESCSI_SG_TRANSFORM, &scsi->transform);
458#if IDESCSI_DEBUG_LOG 458#if IDESCSI_DEBUG_LOG
@@ -811,6 +811,7 @@ static int ide_scsi_probe(ide_drive_t *drive)
811 struct gendisk *g; 811 struct gendisk *g;
812 static int warned; 812 static int warned;
813 int err = -ENOMEM; 813 int err = -ENOMEM;
814 u16 last_lun;
814 815
815 if (!warned && drive->media == ide_cdrom) { 816 if (!warned && drive->media == ide_cdrom) {
816 printk(KERN_WARNING "ide-scsi is deprecated for cd burning! Use ide-cd and give dev=/dev/hdX as device\n"); 817 printk(KERN_WARNING "ide-scsi is deprecated for cd burning! Use ide-cd and give dev=/dev/hdX as device\n");
@@ -836,12 +837,12 @@ static int ide_scsi_probe(ide_drive_t *drive)
836 837
837 host->max_id = 1; 838 host->max_id = 1;
838 839
839 if (drive->id->last_lun) 840 last_lun = drive->id[ATA_ID_LAST_LUN];
840 debug_log("%s: id->last_lun=%u\n", drive->name, 841 if (last_lun)
841 drive->id->last_lun); 842 debug_log("%s: last_lun=%u\n", drive->name, last_lun);
842 843
843 if ((drive->id->last_lun & 0x7) != 7) 844 if ((last_lun & 7) != 7)
844 host->max_lun = (drive->id->last_lun & 0x7) + 1; 845 host->max_lun = (last_lun & 7) + 1;
845 else 846 else
846 host->max_lun = 1; 847 host->max_lun = 1;
847 848