diff options
author | Andrew Morton <akpm@osdl.org> | 2007-02-07 12:17:37 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-02-07 12:17:37 -0500 |
commit | f36702b4de1f7ea57927c8eb88d624504d33fc34 (patch) | |
tree | b23fe9ee501052b93f02a1d67a14c28703357b1f /drivers/ide | |
parent | e139b0b02fd35a68c4353db34d3380c8a7c9a90d (diff) |
hpt366: rework rate filtering tidy
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide')
-rw-r--r-- | drivers/ide/pci/hpt366.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c index 49ae9f6d2183..28bf2bad1541 100644 --- a/drivers/ide/pci/hpt366.c +++ b/drivers/ide/pci/hpt366.c | |||
@@ -379,15 +379,20 @@ static __devinit u8 hpt_revision(struct pci_dev *dev) | |||
379 | switch(dev->device) { | 379 | switch(dev->device) { |
380 | /* Remap new 372N onto 372 */ | 380 | /* Remap new 372N onto 372 */ |
381 | case PCI_DEVICE_ID_TTI_HPT372N: | 381 | case PCI_DEVICE_ID_TTI_HPT372N: |
382 | rev = PCI_DEVICE_ID_TTI_HPT372; break; | 382 | rev = PCI_DEVICE_ID_TTI_HPT372; |
383 | break; | ||
383 | case PCI_DEVICE_ID_TTI_HPT374: | 384 | case PCI_DEVICE_ID_TTI_HPT374: |
384 | rev = PCI_DEVICE_ID_TTI_HPT374; break; | 385 | rev = PCI_DEVICE_ID_TTI_HPT374; |
386 | break; | ||
385 | case PCI_DEVICE_ID_TTI_HPT371: | 387 | case PCI_DEVICE_ID_TTI_HPT371: |
386 | rev = PCI_DEVICE_ID_TTI_HPT371; break; | 388 | rev = PCI_DEVICE_ID_TTI_HPT371; |
389 | break; | ||
387 | case PCI_DEVICE_ID_TTI_HPT302: | 390 | case PCI_DEVICE_ID_TTI_HPT302: |
388 | rev = PCI_DEVICE_ID_TTI_HPT302; break; | 391 | rev = PCI_DEVICE_ID_TTI_HPT302; |
392 | break; | ||
389 | case PCI_DEVICE_ID_TTI_HPT372: | 393 | case PCI_DEVICE_ID_TTI_HPT372: |
390 | rev = PCI_DEVICE_ID_TTI_HPT372; break; | 394 | rev = PCI_DEVICE_ID_TTI_HPT372; |
395 | break; | ||
391 | default: | 396 | default: |
392 | break; | 397 | break; |
393 | } | 398 | } |
@@ -439,7 +444,7 @@ static u8 hpt3xx_ratefilter(ide_drive_t *drive, u8 speed) | |||
439 | goto check_bad_ata33; | 444 | goto check_bad_ata33; |
440 | /* fall thru */ | 445 | /* fall thru */ |
441 | case 0x02: | 446 | case 0x02: |
442 | speed = min(speed, (u8)XFER_UDMA_4); | 447 | speed = min_t(u8, speed, XFER_UDMA_4); |
443 | /* | 448 | /* |
444 | * CHECK ME, Does this need to be set to 5 ?? | 449 | * CHECK ME, Does this need to be set to 5 ?? |
445 | */ | 450 | */ |
@@ -449,13 +454,13 @@ static u8 hpt3xx_ratefilter(ide_drive_t *drive, u8 speed) | |||
449 | !check_in_drive_list(drive, bad_ata66_4)) | 454 | !check_in_drive_list(drive, bad_ata66_4)) |
450 | goto check_bad_ata33; | 455 | goto check_bad_ata33; |
451 | 456 | ||
452 | speed = min(speed, (u8)XFER_UDMA_3); | 457 | speed = min_t(u8, speed, XFER_UDMA_3); |
453 | if (HPT366_ALLOW_ATA66_3 && | 458 | if (HPT366_ALLOW_ATA66_3 && |
454 | !check_in_drive_list(drive, bad_ata66_3)) | 459 | !check_in_drive_list(drive, bad_ata66_3)) |
455 | goto check_bad_ata33; | 460 | goto check_bad_ata33; |
456 | /* fall thru */ | 461 | /* fall thru */ |
457 | case 0x01: | 462 | case 0x01: |
458 | speed = min(speed, (u8)XFER_UDMA_2); | 463 | speed = min_t(u8, speed, XFER_UDMA_2); |
459 | 464 | ||
460 | check_bad_ata33: | 465 | check_bad_ata33: |
461 | if (info->revision >= 4) | 466 | if (info->revision >= 4) |
@@ -465,7 +470,7 @@ static u8 hpt3xx_ratefilter(ide_drive_t *drive, u8 speed) | |||
465 | /* fall thru */ | 470 | /* fall thru */ |
466 | case 0x00: | 471 | case 0x00: |
467 | default: | 472 | default: |
468 | speed = min(speed, (u8)XFER_MW_DMA_2); | 473 | speed = min_t(u8, speed, XFER_MW_DMA_2); |
469 | break; | 474 | break; |
470 | } | 475 | } |
471 | return speed; | 476 | return speed; |