Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f4d3ffa5 authored by Sergei Shtylyov's avatar Sergei Shtylyov Committed by Bartlomiej Zolnierkiewicz
Browse files

ide: move ack_intr() method into 'struct ide_port_ops' (take 2)



Move the ack_intr() method into 'struct ide_port_ops', also renaming it to
test_irq() while at it...

Signed-off-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent eba8999c
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -99,7 +99,7 @@ static const char *buddha_board_name[] = { "Buddha", "Catweasel", "X-Surf" };
     *  Check and acknowledge the interrupt status
     */

static int buddha_ack_intr(ide_hwif_t *hwif)
static int buddha_test_irq(ide_hwif_t *hwif)
{
    unsigned char ch;

@@ -118,8 +118,7 @@ static void xsurf_clear_irq(ide_drive_t *drive)
}

static void __init buddha_setup_ports(struct ide_hw *hw, unsigned long base,
				      unsigned long ctl, unsigned long irq_port,
				      ide_ack_intr_t *ack_intr)
				      unsigned long ctl, unsigned long irq_port)
{
	int i;

@@ -134,14 +133,19 @@ static void __init buddha_setup_ports(struct ide_hw *hw, unsigned long base,
	hw->io_ports.irq_addr = irq_port;

	hw->irq = IRQ_AMIGA_PORTS;
	hw->ack_intr = ack_intr;
}

static const struct ide_port_ops buddha_port_ops = {
	.test_irq		= buddha_test_irq,
};

static const struct ide_port_ops xsurf_port_ops = {
	.clear_irq		= xsurf_clear_irq,
	.test_irq		= buddha_test_irq,
};

static const struct ide_port_info buddha_port_info = {
	.port_ops		= &buddha_port_ops,
	.host_flags		= IDE_HFLAG_MMIO | IDE_HFLAG_NO_DMA,
	.irq_flags		= IRQF_SHARED,
	.chipset		= ide_generic,
@@ -217,8 +221,7 @@ static int __init buddha_init(void)
				irq_port = buddha_board + xsurf_irqports[i];
			}

			buddha_setup_ports(&hw[i], base, ctl, irq_port,
					   buddha_ack_intr);
			buddha_setup_ports(&hw[i], base, ctl, irq_port);

			hws[i] = &hw[i];
		}
+0 −1
Original line number Diff line number Diff line
@@ -128,7 +128,6 @@ static void __init falconide_setup_ports(struct ide_hw *hw)
	hw->io_ports.ctl_addr = ATA_HD_BASE + ATA_HD_CONTROL;

	hw->irq = IRQ_MFP_IDE;
	hw->ack_intr = NULL;
}

    /*
+9 −5
Original line number Diff line number Diff line
@@ -66,7 +66,7 @@ MODULE_PARM_DESC(doubler, "enable support for IDE doublers");
     *  Check and acknowledge the interrupt status
     */

static int gayle_ack_intr(ide_hwif_t *hwif)
static int gayle_test_irq(ide_hwif_t *hwif)
{
    unsigned char ch;

@@ -85,8 +85,7 @@ static void gayle_a1200_clear_irq(ide_drive_t *drive)
}

static void __init gayle_setup_ports(struct ide_hw *hw, unsigned long base,
				     unsigned long ctl, unsigned long irq_port,
				     ide_ack_intr_t *ack_intr)
				     unsigned long ctl, unsigned long irq_port)
{
	int i;

@@ -101,11 +100,15 @@ static void __init gayle_setup_ports(struct ide_hw *hw, unsigned long base,
	hw->io_ports.irq_addr = irq_port;

	hw->irq = IRQ_AMIGA_PORTS;
	hw->ack_intr = ack_intr;
}

static const struct ide_port_ops gayle_a4000_port_ops = {
	.test_irq		= gayle_test_irq,
};

static const struct ide_port_ops gayle_a1200_port_ops = {
	.clear_irq		= gayle_a1200_clear_irq,
	.test_irq		= gayle_test_irq,
};

static const struct ide_port_info gayle_port_info = {
@@ -148,6 +151,7 @@ static int __init gayle_init(void)
	if (a4000) {
	    phys_base = GAYLE_BASE_4000;
	    irqport = (unsigned long)ZTWO_VADDR(GAYLE_IRQ_4000);
	    d.port_ops = &gayle_a4000_port_ops;
	} else {
	    phys_base = GAYLE_BASE_1200;
	    irqport = (unsigned long)ZTWO_VADDR(GAYLE_IRQ_1200);
@@ -164,7 +168,7 @@ static int __init gayle_init(void)
	base = (unsigned long)ZTWO_VADDR(phys_base + i * GAYLE_NEXT_PORT);
	ctrlport = GAYLE_HAS_CONTROL_REG ? (base + GAYLE_CONTROL) : 0;

	gayle_setup_ports(&hw[i], base, ctrlport, irqport, gayle_ack_intr);
	gayle_setup_ports(&hw[i], base, ctrlport, irqport);

	hws[i] = &hw[i];
    }
+2 −1
Original line number Diff line number Diff line
@@ -804,7 +804,8 @@ irqreturn_t ide_intr (int irq, void *dev_id)

	spin_lock_irqsave(&hwif->lock, flags);

	if (hwif->ack_intr && hwif->ack_intr(hwif) == 0)
	if (hwif->port_ops && hwif->port_ops->test_irq &&
	    hwif->port_ops->test_irq(hwif) == 0)
		goto out;

	handler = hwif->handler;
+0 −1
Original line number Diff line number Diff line
@@ -1170,7 +1170,6 @@ static void ide_init_port_hw(ide_hwif_t *hwif, struct ide_hw *hw)
	hwif->irq = hw->irq;
	hwif->dev = hw->dev;
	hwif->gendev.parent = hw->parent ? hw->parent : hw->dev;
	hwif->ack_intr = hw->ack_intr;
	hwif->config_data = hw->config;
}

Loading