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/pci/siimage.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/pci/siimage.c')
-rw-r--r-- | drivers/ide/pci/siimage.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/ide/pci/siimage.c b/drivers/ide/pci/siimage.c index db2b88a369ab..7b5bd8729f64 100644 --- a/drivers/ide/pci/siimage.c +++ b/drivers/ide/pci/siimage.c | |||
@@ -223,7 +223,9 @@ static u8 sil_pata_udma_filter(ide_drive_t *drive) | |||
223 | 223 | ||
224 | static u8 sil_sata_udma_filter(ide_drive_t *drive) | 224 | static u8 sil_sata_udma_filter(ide_drive_t *drive) |
225 | { | 225 | { |
226 | return strstr(drive->id->model, "Maxtor") ? ATA_UDMA5 : ATA_UDMA6; | 226 | char *m = (char *)&drive->id[ATA_ID_PROD]; |
227 | |||
228 | return strstr(m, "Maxtor") ? ATA_UDMA5 : ATA_UDMA6; | ||
227 | } | 229 | } |
228 | 230 | ||
229 | /** | 231 | /** |
@@ -616,8 +618,8 @@ static void __devinit init_mmio_iops_siimage(ide_hwif_t *hwif) | |||
616 | 618 | ||
617 | static int is_dev_seagate_sata(ide_drive_t *drive) | 619 | static int is_dev_seagate_sata(ide_drive_t *drive) |
618 | { | 620 | { |
619 | const char *s = &drive->id->model[0]; | 621 | const char *s = (const char *)&drive->id[ATA_ID_PROD]; |
620 | unsigned len = strnlen(s, sizeof(drive->id->model)); | 622 | unsigned len = strnlen(s, ATA_ID_PROD_LEN); |
621 | 623 | ||
622 | if ((len > 4) && (!memcmp(s, "ST", 2))) | 624 | if ((len > 4) && (!memcmp(s, "ST", 2))) |
623 | if ((!memcmp(s + len - 2, "AS", 2)) || | 625 | if ((!memcmp(s + len - 2, "AS", 2)) || |