aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-floppy.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/ide/ide-floppy.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/ide/ide-floppy.c')
-rw-r--r--drivers/ide/ide-floppy.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index e9034c0125f3..67f93a46f510 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -965,12 +965,12 @@ static sector_t idefloppy_capacity(ide_drive_t *drive)
965 * Check whether we can support a drive, based on the ATAPI IDENTIFY command 965 * Check whether we can support a drive, based on the ATAPI IDENTIFY command
966 * results. 966 * results.
967 */ 967 */
968static int idefloppy_identify_device(ide_drive_t *drive, struct hd_driveid *id) 968static int idefloppy_identify_device(ide_drive_t *drive, u16 *id)
969{ 969{
970 u8 gcw[2]; 970 u8 gcw[2];
971 u8 device_type, protocol, removable, drq_type, packet_size; 971 u8 device_type, protocol, removable, drq_type, packet_size;
972 972
973 *((u16 *) &gcw) = id->config; 973 *((u16 *)&gcw) = id[ATA_ID_CONFIG];
974 974
975 device_type = gcw[1] & 0x1F; 975 device_type = gcw[1] & 0x1F;
976 removable = (gcw[0] & 0x80) >> 7; 976 removable = (gcw[0] & 0x80) >> 7;
@@ -981,7 +981,8 @@ static int idefloppy_identify_device(ide_drive_t *drive, struct hd_driveid *id)
981#ifdef CONFIG_PPC 981#ifdef CONFIG_PPC
982 /* kludge for Apple PowerBook internal zip */ 982 /* kludge for Apple PowerBook internal zip */
983 if (device_type == 5 && 983 if (device_type == 5 &&
984 !strstr(id->model, "CD-ROM") && strstr(id->model, "ZIP")) 984 !strstr((char *)&id[ATA_ID_PROD], "CD-ROM") &&
985 strstr((char *)&id[ATA_ID_PROD], "ZIP"))
985 device_type = 0; 986 device_type = 0;
986#endif 987#endif
987 988
@@ -1024,9 +1025,10 @@ static inline void idefloppy_add_settings(ide_drive_t *drive) { ; }
1024 1025
1025static void idefloppy_setup(ide_drive_t *drive, idefloppy_floppy_t *floppy) 1026static void idefloppy_setup(ide_drive_t *drive, idefloppy_floppy_t *floppy)
1026{ 1027{
1028 u16 *id = drive->id;
1027 u8 gcw[2]; 1029 u8 gcw[2];
1028 1030
1029 *((u16 *) &gcw) = drive->id->config; 1031 *((u16 *)&gcw) = id[ATA_ID_CONFIG];
1030 floppy->pc = floppy->pc_stack; 1032 floppy->pc = floppy->pc_stack;
1031 drive->pc_callback = ide_floppy_callback; 1033 drive->pc_callback = ide_floppy_callback;
1032 1034
@@ -1041,7 +1043,7 @@ static void idefloppy_setup(ide_drive_t *drive, idefloppy_floppy_t *floppy)
1041 * it. It should be fixed as of version 1.9, but to be on the safe side 1043 * it. It should be fixed as of version 1.9, but to be on the safe side
1042 * we'll leave the limitation below for the 2.2.x tree. 1044 * we'll leave the limitation below for the 2.2.x tree.
1043 */ 1045 */
1044 if (!strncmp(drive->id->model, "IOMEGA ZIP 100 ATAPI", 20)) { 1046 if (!strncmp((char *)&id[ATA_ID_PROD], "IOMEGA ZIP 100 ATAPI", 20)) {
1045 drive->atapi_flags |= IDE_AFLAG_ZIP_DRIVE; 1047 drive->atapi_flags |= IDE_AFLAG_ZIP_DRIVE;
1046 /* This value will be visible in the /proc/ide/hdx/settings */ 1048 /* This value will be visible in the /proc/ide/hdx/settings */
1047 floppy->ticks = IDEFLOPPY_TICKS_DELAY; 1049 floppy->ticks = IDEFLOPPY_TICKS_DELAY;
@@ -1052,7 +1054,7 @@ static void idefloppy_setup(ide_drive_t *drive, idefloppy_floppy_t *floppy)
1052 * Guess what? The IOMEGA Clik! drive also needs the above fix. It makes 1054 * Guess what? The IOMEGA Clik! drive also needs the above fix. It makes
1053 * nasty clicking noises without it, so please don't remove this. 1055 * nasty clicking noises without it, so please don't remove this.
1054 */ 1056 */
1055 if (strncmp(drive->id->model, "IOMEGA Clik!", 11) == 0) { 1057 if (strncmp((char *)&id[ATA_ID_PROD], "IOMEGA Clik!", 11) == 0) {
1056 blk_queue_max_sectors(drive->queue, 64); 1058 blk_queue_max_sectors(drive->queue, 64);
1057 drive->atapi_flags |= IDE_AFLAG_CLIK_DRIVE; 1059 drive->atapi_flags |= IDE_AFLAG_CLIK_DRIVE;
1058 } 1060 }