diff options
author | Sergei Shtylyov <sshtylyov@ru.mvista.com> | 2008-10-17 12:09:15 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-10-17 12:09:15 -0400 |
commit | ea2ac5a3b7d33ff9f41ddcee2a92c95b5a32f4e2 (patch) | |
tree | 542f073c0553e02fe52096f645cc4a43e48ab627 /drivers/ide/pci/hpt366.c | |
parent | e5403bff8a4018240f012fd4c7afa24c2e75b469 (diff) |
hpt366: cleanup maskproc() method
Since the maskproc() method calls either mirror the interrupt en/disable via
the nIEN bit of the device control register done by the IDE core before issuing
a command or unmask the interrupt after a command executed in polled mode (when
interrupt is already not expected), it is pointless to manipulate the nIEN bit
in this method; therefore, just do nothing for the drives not on the quirk list.
Move the code to the left by using an early return and the 'else if' construct,
while at it....
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
[bart: fix checkpatch.pl warning]
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci/hpt366.c')
-rw-r--r-- | drivers/ide/pci/hpt366.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c index ca0acb50bc61..a7909e9c720e 100644 --- a/drivers/ide/pci/hpt366.c +++ b/drivers/ide/pci/hpt366.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * Portions Copyright (C) 2001 Sun Microsystems, Inc. | 3 | * Portions Copyright (C) 2001 Sun Microsystems, Inc. |
4 | * Portions Copyright (C) 2003 Red Hat Inc | 4 | * Portions Copyright (C) 2003 Red Hat Inc |
5 | * Portions Copyright (C) 2007 Bartlomiej Zolnierkiewicz | 5 | * Portions Copyright (C) 2007 Bartlomiej Zolnierkiewicz |
6 | * Portions Copyright (C) 2005-2007 MontaVista Software, Inc. | 6 | * Portions Copyright (C) 2005-2008 MontaVista Software, Inc. |
7 | * | 7 | * |
8 | * Thanks to HighPoint Technologies for their assistance, and hardware. | 8 | * Thanks to HighPoint Technologies for their assistance, and hardware. |
9 | * Special Thanks to Jon Burchmore in SanDiego for the deep pockets, his | 9 | * Special Thanks to Jon Burchmore in SanDiego for the deep pockets, his |
@@ -748,26 +748,24 @@ static void hpt3xx_maskproc(ide_drive_t *drive, int mask) | |||
748 | struct pci_dev *dev = to_pci_dev(hwif->dev); | 748 | struct pci_dev *dev = to_pci_dev(hwif->dev); |
749 | struct hpt_info *info = hpt3xx_get_info(hwif->dev); | 749 | struct hpt_info *info = hpt3xx_get_info(hwif->dev); |
750 | 750 | ||
751 | if (drive->quirk_list) { | 751 | if (drive->quirk_list == 0) |
752 | if (info->chip_type >= HPT370) { | 752 | return; |
753 | u8 scr1 = 0; | 753 | |
754 | 754 | if (info->chip_type >= HPT370) { | |
755 | pci_read_config_byte(dev, 0x5a, &scr1); | 755 | u8 scr1 = 0; |
756 | if (((scr1 & 0x10) >> 4) != mask) { | 756 | |
757 | if (mask) | 757 | pci_read_config_byte(dev, 0x5a, &scr1); |
758 | scr1 |= 0x10; | 758 | if (((scr1 & 0x10) >> 4) != mask) { |
759 | else | ||
760 | scr1 &= ~0x10; | ||
761 | pci_write_config_byte(dev, 0x5a, scr1); | ||
762 | } | ||
763 | } else { | ||
764 | if (mask) | 759 | if (mask) |
765 | disable_irq(hwif->irq); | 760 | scr1 |= 0x10; |
766 | else | 761 | else |
767 | enable_irq (hwif->irq); | 762 | scr1 &= ~0x10; |
763 | pci_write_config_byte(dev, 0x5a, scr1); | ||
768 | } | 764 | } |
769 | } else | 765 | } else if (mask) |
770 | outb(ATA_DEVCTL_OBS | (mask ? 2 : 0), hwif->io_ports.ctl_addr); | 766 | disable_irq(hwif->irq); |
767 | else | ||
768 | enable_irq(hwif->irq); | ||
771 | } | 769 | } |
772 | 770 | ||
773 | /* | 771 | /* |