ide: use 'drive->dn & 1' instead of drive->select.b.unit
[firefly-linux-kernel-4.4.55.git] / drivers / ide / pci / triflex.c
index be8715dcee05ec735c35c8b88eb2493f0305736e..42fb98f268d5a988192dfbda85389bd40c8e201f 100644 (file)
@@ -38,13 +38,12 @@ static void triflex_set_mode(ide_drive_t *drive, const u8 speed)
 {
        ide_hwif_t *hwif = HWIF(drive);
        struct pci_dev *dev = to_pci_dev(hwif->dev);
-       u8 channel_offset = hwif->channel ? 0x74 : 0x70;
-       u16 timing = 0;
        u32 triflex_timings = 0;
-       u8 unit = (drive->select.b.unit & 0x01);
-       
+       u16 timing = 0;
+       u8 channel_offset = hwif->channel ? 0x74 : 0x70, unit = drive->dn & 1;
+
        pci_read_config_dword(dev, channel_offset, &triflex_timings);
-       
+
        switch(speed) {
                case XFER_MW_DMA_2:
                        timing = 0x0103;