diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-10-10 16:39:31 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-10-10 16:39:31 -0400 |
commit | 718c72e83da295efc9c8625b6f380ef10352d955 (patch) | |
tree | fce563b17065f0524595cd167c86934f0b895d2b /drivers/ide/ide-probe.c | |
parent | ff2779b568e70822e0ef2cc7afeeefbe7c607652 (diff) |
ide: use ata_id_is_cfa()
Use ata_id_is_cfa() in do_identify() instead of open-coding
check for CompactFlash devices (the inline helper also takes
care of detecting CFs advertising themselves as ATA disks).
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-probe.c')
-rw-r--r-- | drivers/ide/ide-probe.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index be121ffcc1dc..e526f4967148 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c | |||
@@ -116,7 +116,7 @@ static inline void do_identify (ide_drive_t *drive, u8 cmd) | |||
116 | ide_hwif_t *hwif = HWIF(drive); | 116 | ide_hwif_t *hwif = HWIF(drive); |
117 | u16 *id = drive->id; | 117 | u16 *id = drive->id; |
118 | char *m = (char *)&id[ATA_ID_PROD]; | 118 | char *m = (char *)&id[ATA_ID_PROD]; |
119 | int bswap = 1; | 119 | int bswap = 1, is_cfa; |
120 | 120 | ||
121 | /* read 512 bytes of id info */ | 121 | /* read 512 bytes of id info */ |
122 | hwif->tp_ops->input_data(drive, NULL, id, SECTOR_SIZE); | 122 | hwif->tp_ops->input_data(drive, NULL, id, SECTOR_SIZE); |
@@ -212,17 +212,15 @@ static inline void do_identify (ide_drive_t *drive, u8 cmd) | |||
212 | * Not an ATAPI device: looks like a "regular" hard disk | 212 | * Not an ATAPI device: looks like a "regular" hard disk |
213 | */ | 213 | */ |
214 | 214 | ||
215 | /* | 215 | is_cfa = ata_id_is_cfa(id); |
216 | * 0x848a = CompactFlash device | 216 | |
217 | * These are *not* removable in Linux definition of the term | 217 | /* CF devices are *not* removable in Linux definition of the term */ |
218 | */ | 218 | if (is_cfa == 0 && (id[ATA_ID_CONFIG] & (1 << 7))) |
219 | if (id[ATA_ID_CONFIG] != 0x848a && (id[ATA_ID_CONFIG] & (1 << 7))) | ||
220 | drive->removable = 1; | 219 | drive->removable = 1; |
221 | 220 | ||
222 | drive->media = ide_disk; | 221 | drive->media = ide_disk; |
223 | 222 | ||
224 | printk(KERN_CONT "%s DISK drive\n", | 223 | printk(KERN_CONT "%s DISK drive\n", is_cfa ? "CFA" : "ATA"); |
225 | (id[ATA_ID_CONFIG] == 0x848a) ? "CFA" : "ATA"); | ||
226 | 224 | ||
227 | return; | 225 | return; |
228 | 226 | ||