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 | 4dde4492d850a4c9bcaa92e5bd7f4eebe3e2f5ab (patch) | |
tree | ee3be70390e4c617b44329edef0a05039f59c81a /drivers/ide/ide-cd.c | |
parent | 5b90e990928919ae411a68b865e8a6ecac09a603 (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-cd.c')
-rw-r--r-- | drivers/ide/ide-cd.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index 03c2cb6a58bc..46f9720f1ec9 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c | |||
@@ -1866,14 +1866,14 @@ static const struct cd_list_entry ide_cd_quirks_list[] = { | |||
1866 | { NULL, NULL, 0 } | 1866 | { NULL, NULL, 0 } |
1867 | }; | 1867 | }; |
1868 | 1868 | ||
1869 | static unsigned int ide_cd_flags(struct hd_driveid *id) | 1869 | static unsigned int ide_cd_flags(u16 *id) |
1870 | { | 1870 | { |
1871 | const struct cd_list_entry *cle = ide_cd_quirks_list; | 1871 | const struct cd_list_entry *cle = ide_cd_quirks_list; |
1872 | 1872 | ||
1873 | while (cle->id_model) { | 1873 | while (cle->id_model) { |
1874 | if (strcmp(cle->id_model, id->model) == 0 && | 1874 | if (strcmp(cle->id_model, (char *)&id[ATA_ID_PROD]) == 0 && |
1875 | (cle->id_firmware == NULL || | 1875 | (cle->id_firmware == NULL || |
1876 | strstr(id->fw_rev, cle->id_firmware))) | 1876 | strstr((char *)&id[ATA_ID_FW_REV], cle->id_firmware))) |
1877 | return cle->cd_flags; | 1877 | return cle->cd_flags; |
1878 | cle++; | 1878 | cle++; |
1879 | } | 1879 | } |
@@ -1885,7 +1885,8 @@ static int ide_cdrom_setup(ide_drive_t *drive) | |||
1885 | { | 1885 | { |
1886 | struct cdrom_info *cd = drive->driver_data; | 1886 | struct cdrom_info *cd = drive->driver_data; |
1887 | struct cdrom_device_info *cdi = &cd->devinfo; | 1887 | struct cdrom_device_info *cdi = &cd->devinfo; |
1888 | struct hd_driveid *id = drive->id; | 1888 | u16 *id = drive->id; |
1889 | char *fw_rev = (char *)&id[ATA_ID_FW_REV]; | ||
1889 | int nslots; | 1890 | int nslots; |
1890 | 1891 | ||
1891 | blk_queue_prep_rq(drive->queue, ide_cdrom_prep_fn); | 1892 | blk_queue_prep_rq(drive->queue, ide_cdrom_prep_fn); |
@@ -1900,15 +1901,15 @@ static int ide_cdrom_setup(ide_drive_t *drive) | |||
1900 | drive->atapi_flags = IDE_AFLAG_MEDIA_CHANGED | IDE_AFLAG_NO_EJECT | | 1901 | drive->atapi_flags = IDE_AFLAG_MEDIA_CHANGED | IDE_AFLAG_NO_EJECT | |
1901 | ide_cd_flags(id); | 1902 | ide_cd_flags(id); |
1902 | 1903 | ||
1903 | if ((id->config & 0x0060) == 0x20) | 1904 | if ((id[ATA_ID_CONFIG] & 0x0060) == 0x20) |
1904 | drive->atapi_flags |= IDE_AFLAG_DRQ_INTERRUPT; | 1905 | drive->atapi_flags |= IDE_AFLAG_DRQ_INTERRUPT; |
1905 | 1906 | ||
1906 | if ((drive->atapi_flags & IDE_AFLAG_VERTOS_300_SSD) && | 1907 | if ((drive->atapi_flags & IDE_AFLAG_VERTOS_300_SSD) && |
1907 | id->fw_rev[4] == '1' && id->fw_rev[6] <= '2') | 1908 | fw_rev[4] == '1' && fw_rev[6] <= '2') |
1908 | drive->atapi_flags |= (IDE_AFLAG_TOCTRACKS_AS_BCD | | 1909 | drive->atapi_flags |= (IDE_AFLAG_TOCTRACKS_AS_BCD | |
1909 | IDE_AFLAG_TOCADDR_AS_BCD); | 1910 | IDE_AFLAG_TOCADDR_AS_BCD); |
1910 | else if ((drive->atapi_flags & IDE_AFLAG_VERTOS_600_ESD) && | 1911 | else if ((drive->atapi_flags & IDE_AFLAG_VERTOS_600_ESD) && |
1911 | id->fw_rev[4] == '1' && id->fw_rev[6] <= '2') | 1912 | fw_rev[4] == '1' && fw_rev[6] <= '2') |
1912 | drive->atapi_flags |= IDE_AFLAG_TOCTRACKS_AS_BCD; | 1913 | drive->atapi_flags |= IDE_AFLAG_TOCTRACKS_AS_BCD; |
1913 | else if (drive->atapi_flags & IDE_AFLAG_SANYO_3CD) | 1914 | else if (drive->atapi_flags & IDE_AFLAG_SANYO_3CD) |
1914 | /* 3 => use CD in slot 0 */ | 1915 | /* 3 => use CD in slot 0 */ |