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.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.c')
-rw-r--r-- | drivers/ide/ide.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index 772451600e4d..8d3fab33a3c7 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c | |||
@@ -328,7 +328,7 @@ int set_using_dma(ide_drive_t *drive, int arg) | |||
328 | if (arg < 0 || arg > 1) | 328 | if (arg < 0 || arg > 1) |
329 | return -EINVAL; | 329 | return -EINVAL; |
330 | 330 | ||
331 | if (!drive->id || !(drive->id->capability & 1)) | 331 | if ((drive->driveid->capability & 1) == 0) |
332 | goto out; | 332 | goto out; |
333 | 333 | ||
334 | if (hwif->dma_ops == NULL) | 334 | if (hwif->dma_ops == NULL) |
@@ -710,21 +710,21 @@ static ssize_t model_show(struct device *dev, struct device_attribute *attr, | |||
710 | char *buf) | 710 | char *buf) |
711 | { | 711 | { |
712 | ide_drive_t *drive = to_ide_device(dev); | 712 | ide_drive_t *drive = to_ide_device(dev); |
713 | return sprintf(buf, "%s\n", drive->id->model); | 713 | return sprintf(buf, "%s\n", (char *)&drive->id[ATA_ID_PROD]); |
714 | } | 714 | } |
715 | 715 | ||
716 | static ssize_t firmware_show(struct device *dev, struct device_attribute *attr, | 716 | static ssize_t firmware_show(struct device *dev, struct device_attribute *attr, |
717 | char *buf) | 717 | char *buf) |
718 | { | 718 | { |
719 | ide_drive_t *drive = to_ide_device(dev); | 719 | ide_drive_t *drive = to_ide_device(dev); |
720 | return sprintf(buf, "%s\n", drive->id->fw_rev); | 720 | return sprintf(buf, "%s\n", (char *)&drive->id[ATA_ID_FW_REV]); |
721 | } | 721 | } |
722 | 722 | ||
723 | static ssize_t serial_show(struct device *dev, struct device_attribute *attr, | 723 | static ssize_t serial_show(struct device *dev, struct device_attribute *attr, |
724 | char *buf) | 724 | char *buf) |
725 | { | 725 | { |
726 | ide_drive_t *drive = to_ide_device(dev); | 726 | ide_drive_t *drive = to_ide_device(dev); |
727 | return sprintf(buf, "%s\n", drive->id->serial_no); | 727 | return sprintf(buf, "%s\n", (char *)&drive->id[ATA_ID_SERNO]); |
728 | } | 728 | } |
729 | 729 | ||
730 | static struct device_attribute ide_dev_attrs[] = { | 730 | static struct device_attribute ide_dev_attrs[] = { |