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: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent ff2779b5
...@@ -116,7 +116,7 @@ static inline void do_identify (ide_drive_t *drive, u8 cmd) ...@@ -116,7 +116,7 @@ static inline void do_identify (ide_drive_t *drive, u8 cmd)
ide_hwif_t *hwif = HWIF(drive); ide_hwif_t *hwif = HWIF(drive);
u16 *id = drive->id; u16 *id = drive->id;
char *m = (char *)&id[ATA_ID_PROD]; char *m = (char *)&id[ATA_ID_PROD];
int bswap = 1; int bswap = 1, is_cfa;
/* read 512 bytes of id info */ /* read 512 bytes of id info */
hwif->tp_ops->input_data(drive, NULL, id, SECTOR_SIZE); 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,17 +212,15 @@ static inline void do_identify (ide_drive_t *drive, u8 cmd)
* Not an ATAPI device: looks like a "regular" hard disk * Not an ATAPI device: looks like a "regular" hard disk
*/ */
/* is_cfa = ata_id_is_cfa(id);
* 0x848a = CompactFlash device
* These are *not* removable in Linux definition of the term /* CF devices are *not* removable in Linux definition of the term */
*/ if (is_cfa == 0 && (id[ATA_ID_CONFIG] & (1 << 7)))
if (id[ATA_ID_CONFIG] != 0x848a && (id[ATA_ID_CONFIG] & (1 << 7)))
drive->removable = 1; drive->removable = 1;
drive->media = ide_disk; drive->media = ide_disk;
printk(KERN_CONT "%s DISK drive\n", printk(KERN_CONT "%s DISK drive\n", is_cfa ? "CFA" : "ATA");
(id[ATA_ID_CONFIG] == 0x848a) ? "CFA" : "ATA");
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment