aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-io.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-27 07:46:27 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-27 07:46:27 -0400
commit255115fb35f80735c21a1cbe9809e9795a3af26e (patch)
tree55952820ef05e6f11c80c828b83a6cfdac366a84 /drivers/ide/ide-io.c
parentc7db966bbbf216b336da921e5d7ba5b9c8467ac1 (diff)
ide: allow host drivers to specify IRQ flags
* Add ->irq_flags field to struct ide_port_info and struct ide_host. * Update host drivers and IDE PCI code to use ->irq_flags field. * Convert init_irq() and ide_intr() to use host->irq_flags. This fixes handling of shared IRQs for non-PCI hosts and removes ugly ifdeffery from core IDE code. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-io.c')
-rw-r--r--drivers/ide/ide-io.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 030b0ea1a1e1..7007c48e27ae 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -841,6 +841,7 @@ static void unexpected_intr(int irq, ide_hwif_t *hwif)
841irqreturn_t ide_intr (int irq, void *dev_id) 841irqreturn_t ide_intr (int irq, void *dev_id)
842{ 842{
843 ide_hwif_t *hwif = (ide_hwif_t *)dev_id; 843 ide_hwif_t *hwif = (ide_hwif_t *)dev_id;
844 struct ide_host *host = hwif->host;
844 ide_drive_t *uninitialized_var(drive); 845 ide_drive_t *uninitialized_var(drive);
845 ide_handler_t *handler; 846 ide_handler_t *handler;
846 unsigned long flags; 847 unsigned long flags;
@@ -848,8 +849,8 @@ irqreturn_t ide_intr (int irq, void *dev_id)
848 irqreturn_t irq_ret = IRQ_NONE; 849 irqreturn_t irq_ret = IRQ_NONE;
849 int plug_device = 0; 850 int plug_device = 0;
850 851
851 if (hwif->host->host_flags & IDE_HFLAG_SERIALIZE) { 852 if (host->host_flags & IDE_HFLAG_SERIALIZE) {
852 if (hwif != hwif->host->cur_port) 853 if (hwif != host->cur_port)
853 goto out_early; 854 goto out_early;
854 } 855 }
855 856
@@ -872,27 +873,19 @@ irqreturn_t ide_intr (int irq, void *dev_id)
872 * 873 *
873 * For PCI, we cannot tell the difference, 874 * For PCI, we cannot tell the difference,
874 * so in that case we just ignore it and hope it goes away. 875 * so in that case we just ignore it and hope it goes away.
875 *
876 * FIXME: unexpected_intr should be hwif-> then we can
877 * remove all the ifdef PCI crap
878 */ 876 */
879#ifdef CONFIG_BLK_DEV_IDEPCI 877 if ((host->irq_flags & IRQF_SHARED) == 0) {
880 if (hwif->chipset != ide_pci)
881#endif /* CONFIG_BLK_DEV_IDEPCI */
882 {
883 /* 878 /*
884 * Probably not a shared PCI interrupt, 879 * Probably not a shared PCI interrupt,
885 * so we can safely try to do something about it: 880 * so we can safely try to do something about it:
886 */ 881 */
887 unexpected_intr(irq, hwif); 882 unexpected_intr(irq, hwif);
888#ifdef CONFIG_BLK_DEV_IDEPCI
889 } else { 883 } else {
890 /* 884 /*
891 * Whack the status register, just in case 885 * Whack the status register, just in case
892 * we have a leftover pending IRQ. 886 * we have a leftover pending IRQ.
893 */ 887 */
894 (void)hwif->tp_ops->read_status(hwif); 888 (void)hwif->tp_ops->read_status(hwif);
895#endif /* CONFIG_BLK_DEV_IDEPCI */
896 } 889 }
897 goto out; 890 goto out;
898 } 891 }