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>
diff --git a/drivers/ide/pci/pdc202xx_old.c b/drivers/ide/pci/pdc202xx_old.c
index de9a274..23e861b 100644
--- a/drivers/ide/pci/pdc202xx_old.c
+++ b/drivers/ide/pci/pdc202xx_old.c
@@ -86,7 +86,7 @@
* Prefetch_EN / IORDY_EN / PA[3:0] bits of register A
*/
AP &= ~0x3f;
- if (drive->id->capability & 4)
+ if (drive->driveid->capability & 4)
AP |= 0x20; /* set IORDY_EN bit */
if (drive->media == ide_disk)
AP |= 0x10; /* set Prefetch_EN bit */
@@ -154,10 +154,10 @@
static void pdc202xx_quirkproc(ide_drive_t *drive)
{
- const char **list, *model = drive->id->model;
+ const char **list, *m = (char *)&drive->id[ATA_ID_PROD];
for (list = pdc_quirk_drives; *list != NULL; list++)
- if (strstr(model, *list) != NULL) {
+ if (strstr(m, *list) != NULL) {
drive->quirk_list = 2;
return;
}