Commit c0177fe9 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] irqs: hotplug drivers

Update hotplug and pcmcia drivers to the new IRQ API.
parent 607ace4b
......@@ -446,7 +446,7 @@ cpci_find_slot(struct pci_bus *bus, unsigned int devfn)
}
/* This is the interrupt mode interrupt handler */
void
irqreturn_t
cpci_hp_intr(int irq, void *data, struct pt_regs *regs)
{
dbg("entered cpci_hp_intr");
......@@ -455,7 +455,7 @@ cpci_hp_intr(int irq, void *data, struct pt_regs *regs)
if((controller->irq_flags & SA_SHIRQ) &&
!controller->ops->check_irq(controller->dev_id)) {
dbg("exited cpci_hp_intr, not our interrupt");
return;
return IRQ_NONE;
}
/* Disable ENUM interrupt */
......@@ -465,6 +465,7 @@ cpci_hp_intr(int irq, void *data, struct pt_regs *regs)
dbg("Signal event_semaphore");
up(&event_semaphore);
dbg("exited cpci_hp_intr");
return IRQ_HANDLED;
}
/*
......
......@@ -29,6 +29,7 @@
#define _CPQPHP_H
#include "pci_hotplug.h"
#include <linux/interrupt.h>
#include <asm/io.h> /* for read? and write? functions */
......@@ -408,7 +409,7 @@ extern void cpqhp_create_ctrl_files (struct controller *ctrl);
/* controller functions */
extern void cpqhp_pushbutton_thread (unsigned long event_pointer);
extern void cpqhp_ctrl_intr (int IRQ, struct controller *ctrl_input, struct pt_regs *regs);
extern irqreturn_t cpqhp_ctrl_intr (int IRQ, void *data, struct pt_regs *regs);
extern int cpqhp_find_available_resources (struct controller *ctrl, void *rom_start);
extern int cpqhp_event_start_thread (void);
extern void cpqhp_event_stop_thread (void);
......
......@@ -1148,8 +1148,7 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
/* set up the interrupt */
dbg("HPC interrupt = %d \n", ctrl->interrupt);
if (request_irq(ctrl->interrupt,
(void (*)(int, void *, struct pt_regs *)) &cpqhp_ctrl_intr,
if (request_irq(ctrl->interrupt, cpqhp_ctrl_intr,
SA_SHIRQ, MY_NAME, ctrl)) {
err("Can't get irq %d for the hotplug pci controller\n", ctrl->interrupt);
rc = -ENODEV;
......
......@@ -916,8 +916,9 @@ int cpqhp_resource_sort_and_combine(struct pci_resource **head)
}
void cpqhp_ctrl_intr(int IRQ, struct controller * ctrl, struct pt_regs *regs)
irqreturn_t cpqhp_ctrl_intr(int IRQ, void *data, struct pt_regs *regs)
{
struct controller *ctrl = data;
u8 schedule_flag = 0;
u16 misc;
u32 Diff;
......@@ -929,7 +930,7 @@ void cpqhp_ctrl_intr(int IRQ, struct controller * ctrl, struct pt_regs *regs)
// Check to see if it was our interrupt
//*********************************
if (!(misc & 0x000C)) {
return;
return IRQ_NONE;
}
if (misc & 0x0004) {
......@@ -974,7 +975,7 @@ void cpqhp_ctrl_intr(int IRQ, struct controller * ctrl, struct pt_regs *regs)
up(&event_semaphore);
dbg("Signal event_semaphore\n");
}
return IRQ_HANDLED;
}
......
......@@ -219,6 +219,7 @@ static unsigned char indirect_read(int socket, unsigned short reg)
return val;
}
#if 0
static unsigned short indirect_read16(int socket, unsigned short reg)
{
unsigned short int port;
......@@ -235,6 +236,7 @@ static unsigned short indirect_read16(int socket, unsigned short reg)
spin_unlock_irqrestore(&port_lock,flags);
return tmp;
}
#endif
static void indirect_write(int socket, unsigned short reg, unsigned char value)
{
......@@ -334,11 +336,12 @@ static void i82092aa_bh(void *dummy)
static DECLARE_WORK(i82092aa_task, i82092aa_bh, NULL);
static void i82092aa_interrupt(int irq, void *dev, struct pt_regs *regs)
static irqreturn_t i82092aa_interrupt(int irq, void *dev, struct pt_regs *regs)
{
int i;
int loopcount = 0;
int handled = 0;
unsigned int events, active=0;
/* enter("i82092aa_interrupt");*/
......@@ -362,6 +365,7 @@ static void i82092aa_interrupt(int irq, void *dev, struct pt_regs *regs)
if ((csc==0) || /* no events on this socket */
(sockets[i].handler==NULL)) /* no way to handle events */
continue;
handled = 1;
events = 0;
if (csc & I365_CSC_DETECT) {
......@@ -390,7 +394,7 @@ static void i82092aa_interrupt(int irq, void *dev, struct pt_regs *regs)
break;
}
return IRQ_RETVAL(handled);
/* leave("i82092aa_interrupt");*/
}
......
#ifndef _INCLUDE_GUARD_i82092aa_H_
#define _INCLUDE_GUARD_i82092aa_H_
#include <linux/interrupt.h>
/* $Id: i82092aa.h,v 1.1.1.1 2001/09/19 14:53:15 dwmw2 Exp $ */
/* Debuging defines */
......@@ -21,7 +23,7 @@
static int i82092aa_pci_probe(struct pci_dev *dev, const struct pci_device_id *id);
static void i82092aa_pci_remove(struct pci_dev *dev);
static int card_present(int socketno);
static void i82092aa_interrupt(int irq, void *dev, struct pt_regs *regs);
static irqreturn_t i82092aa_interrupt(int irq, void *dev, struct pt_regs *regs);
......
......@@ -78,7 +78,7 @@ static const char *version =
#define DEBUG(n, args...) do { } while (0)
#endif
static void i365_count_irq(int, void *, struct pt_regs *);
static irqreturn_t i365_count_irq(int, void *, struct pt_regs *);
static inline int _check_irq(int irq, int flags)
{
if (request_irq(irq, i365_count_irq, flags, "x", i365_count_irq) != 0)
......@@ -535,11 +535,12 @@ static u_int __init set_bridge_opts(u_short s, u_short ns)
static volatile u_int irq_hits;
static u_short irq_sock;
static void i365_count_irq(int irq, void *dev, struct pt_regs *regs)
static irqreturn_t i365_count_irq(int irq, void *dev, struct pt_regs *regs)
{
i365_get(irq_sock, I365_CSC);
irq_hits++;
DEBUG(2, "-> hit on irq %d\n", irq);
return IRQ_HANDLED;
}
static u_int __init test_irq(u_short sock, int irq)
......@@ -627,11 +628,6 @@ static int to_cycles(int ns)
return ns/cycle_time;
}
static int to_ns(int cycles)
{
return cycle_time*cycles;
}
/*====================================================================*/
#ifdef CONFIG_ISA
......@@ -939,7 +935,7 @@ static DECLARE_WORK(pcic_task, pcic_bh, NULL);
static unsigned long last_detect_jiffies;
static void pcic_interrupt(int irq, void *dev,
static irqreturn_t pcic_interrupt(int irq, void *dev,
struct pt_regs *regs)
{
int i, j, csc;
......@@ -947,7 +943,8 @@ static void pcic_interrupt(int irq, void *dev,
#ifdef CONFIG_ISA
u_long flags = 0;
#endif
int handled = 0;
DEBUG(4, "i82365: pcic_interrupt(%d)\n", irq);
for (j = 0; j < 20; j++) {
......@@ -956,6 +953,7 @@ static void pcic_interrupt(int irq, void *dev,
if ((socket[i].cs_irq != irq) &&
(socket[i].cap.pci_irq != irq))
continue;
handled = 1;
ISA_LOCK(i, flags);
csc = i365_get(i, I365_CSC);
if ((csc == 0) || (!socket[i].handler) ||
......@@ -1002,6 +1000,7 @@ static void pcic_interrupt(int irq, void *dev,
printk(KERN_NOTICE "i82365: infinite loop in interrupt handler\n");
DEBUG(4, "i82365: interrupt done\n");
return IRQ_RETVAL(handled);
} /* pcic_interrupt */
static void pcic_interrupt_wrapper(u_long data)
......
......@@ -111,7 +111,7 @@ MODULE_PARM(cycle_time, "i");
/*====================================================================*/
static void tcic_interrupt(int irq, void *dev, struct pt_regs *regs);
static irqreturn_t tcic_interrupt(int irq, void *dev, struct pt_regs *regs);
static void tcic_timer(u_long data);
static struct pccard_operations tcic_operations;
......@@ -229,9 +229,10 @@ static int to_cycles(int ns)
static volatile u_int irq_hits;
static void __init tcic_irq_count(int irq, void *dev, struct pt_regs *regs)
static irqreturn_t __init tcic_irq_count(int irq, void *dev, struct pt_regs *regs)
{
irq_hits++;
return IRQ_HANDLED;
}
static u_int __init try_irq(int irq)
......@@ -565,7 +566,7 @@ static void tcic_bh(void *dummy)
static DECLARE_WORK(tcic_task, tcic_bh, NULL);
static void tcic_interrupt(int irq, void *dev, struct pt_regs *regs)
static irqreturn_t tcic_interrupt(int irq, void *dev, struct pt_regs *regs)
{
int i, quick = 0;
u_char latch, sstat;
......@@ -575,7 +576,7 @@ static void tcic_interrupt(int irq, void *dev, struct pt_regs *regs)
if (active) {
printk(KERN_NOTICE "tcic: reentered interrupt handler!\n");
return;
return IRQ_NONE;
} else
active = 1;
......@@ -620,7 +621,7 @@ static void tcic_interrupt(int irq, void *dev, struct pt_regs *regs)
active = 0;
DEBUG(2, "tcic: interrupt done\n");
return IRQ_HANDLED;
} /* tcic_interrupt */
static void tcic_timer(u_long data)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment