Merge branch 'irq-upstream' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/misc-2.6

* 'irq-upstream' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/misc-2.6:
  [SPARC, XEN, NET/CXGB3] use irq_handler_t where appropriate
  drivers/char/riscom8: clean up irq handling
  isdn/sc: irq handler clean
  isdn/act2000: fix major bug. clean irq handler.
  char/pcmcia/synclink_cs: trim trailing whitespace
  drivers/char/ip2: separate polling and irq-driven work entry points
  drivers/char/ip2: split out irq core logic into separate function
  [NETDRVR] lib82596, netxen: delete pointless tests from irq handler
  Eliminate pointless casts from void* in a few driver irq handlers.
  [PARPORT] Remove unused 'irq' argument from parport irq functions
  [PARPORT] Kill useful 'irq' arg from parport_{generic_irq,ieee1284_interrupt}
  [PARPORT] Consolidate code copies into a single generic irq handler
This commit is contained in:
Linus Torvalds 2007-10-23 18:57:39 -07:00
commit 25c263542d
39 changed files with 485 additions and 537 deletions

View File

@ -479,7 +479,7 @@ EXPORT_SYMBOL(pdma_areasize);
extern void floppy_hardint(void);
static irqreturn_t (*floppy_irq_handler)(int irq, void *dev_id);
static irq_handler_t floppy_irq_handler;
void sparc_floppy_irq(int irq, void *dev_id, struct pt_regs *regs)
{
@ -500,7 +500,7 @@ void sparc_floppy_irq(int irq, void *dev_id, struct pt_regs *regs)
}
int sparc_floppy_request_irq(int irq, unsigned long flags,
irqreturn_t (*irq_handler)(int irq, void *))
irq_handler_t irq_handler)
{
floppy_irq_handler = irq_handler;
return request_fast_irq(irq, floppy_hardint, flags, "floppy");

View File

@ -383,7 +383,7 @@ static void unbind_from_irq(unsigned int irq)
}
int bind_evtchn_to_irqhandler(unsigned int evtchn,
irqreturn_t (*handler)(int, void *),
irq_handler_t handler,
unsigned long irqflags,
const char *devname, void *dev_id)
{
@ -402,7 +402,7 @@ int bind_evtchn_to_irqhandler(unsigned int evtchn,
EXPORT_SYMBOL_GPL(bind_evtchn_to_irqhandler);
int bind_virq_to_irqhandler(unsigned int virq, unsigned int cpu,
irqreturn_t (*handler)(int, void *),
irq_handler_t handler,
unsigned long irqflags, const char *devname, void *dev_id)
{
unsigned int irq;

View File

@ -1382,8 +1382,9 @@ static inline void rx_data_av_handler (hrz_dev * dev) {
/********** interrupt handler **********/
static irqreturn_t interrupt_handler(int irq, void *dev_id) {
hrz_dev * dev = (hrz_dev *) dev_id;
static irqreturn_t interrupt_handler(int irq, void *dev_id)
{
hrz_dev *dev = dev_id;
u32 int_source;
unsigned int irq_ok;

View File

@ -752,7 +752,7 @@ retry:
continue;
rc = request_irq( ip2config.irq[i], ip2_interrupt,
IP2_SA_FLAGS | (ip2config.type[i] == PCI ? IRQF_SHARED : 0),
pcName, (void *)&pcName);
pcName, i2BoardPtrTable[i]);
if (rc) {
printk(KERN_ERR "IP2: an request_irq failed: error %d\n",rc);
ip2config.irq[i] = CIR_POLL;
@ -1166,12 +1166,37 @@ ip2_interrupt_bh(struct work_struct *work)
/* */
/* */
/******************************************************************************/
static irqreturn_t
ip2_interrupt(int irq, void *dev_id)
static void
ip2_irq_work(i2eBordStrPtr pB)
{
#ifdef USE_IQI
if (NO_MAIL_HERE != ( pB->i2eStartMail = iiGetMail(pB))) {
// Disable his interrupt (will be enabled when serviced)
// This is mostly to protect from reentrancy.
iiDisableMailIrq(pB);
// Park the board on the immediate queue for processing.
schedule_work(&pB->tqueue_interrupt);
// Make sure the immediate queue is flagged to fire.
}
#else
// We are using immediate servicing here. This sucks and can
// cause all sorts of havoc with ppp and others. The failsafe
// check on iiSendPendingMail could also throw a hairball.
i2ServiceBoard( pB );
#endif /* USE_IQI */
}
static void
ip2_polled_interrupt(void)
{
int i;
i2eBordStrPtr pB;
int handled = 0;
const int irq = 0;
ip2trace (ITRC_NO_PORT, ITRC_INTR, 99, 1, irq );
@ -1183,32 +1208,28 @@ ip2_interrupt(int irq, void *dev_id)
// IRQ = 0 for polled boards, we won't poll "IRQ" boards
if ( pB && (pB->i2eUsingIrq == irq) ) {
handled = 1;
#ifdef USE_IQI
if (NO_MAIL_HERE != ( pB->i2eStartMail = iiGetMail(pB))) {
// Disable his interrupt (will be enabled when serviced)
// This is mostly to protect from reentrancy.
iiDisableMailIrq(pB);
// Park the board on the immediate queue for processing.
schedule_work(&pB->tqueue_interrupt);
// Make sure the immediate queue is flagged to fire.
}
#else
// We are using immediate servicing here. This sucks and can
// cause all sorts of havoc with ppp and others. The failsafe
// check on iiSendPendingMail could also throw a hairball.
i2ServiceBoard( pB );
#endif /* USE_IQI */
ip2_irq_work(pB);
}
}
++irq_counter;
ip2trace (ITRC_NO_PORT, ITRC_INTR, ITRC_RETURN, 0 );
return IRQ_RETVAL(handled);
}
static irqreturn_t
ip2_interrupt(int irq, void *dev_id)
{
i2eBordStrPtr pB = dev_id;
ip2trace (ITRC_NO_PORT, ITRC_INTR, 99, 1, pB->i2eUsingIrq );
ip2_irq_work(pB);
++irq_counter;
ip2trace (ITRC_NO_PORT, ITRC_INTR, ITRC_RETURN, 0 );
return IRQ_HANDLED;
}
/******************************************************************************/
@ -1231,7 +1252,7 @@ ip2_poll(unsigned long arg)
// Just polled boards, IRQ = 0 will hit all non-interrupt boards.
// It will NOT poll boards handled by hard interrupts.
// The issue of queued BH interrups is handled in ip2_interrupt().
ip2_interrupt(0, NULL);
ip2_polled_interrupt();
PollTimer.expires = POLL_TIMEOUT;
add_timer( &PollTimer );

File diff suppressed because it is too large Load Diff

View File

@ -267,9 +267,9 @@ static ssize_t pp_write (struct file * file, const char __user * buf,
return bytes_written;
}
static void pp_irq (int irq, void * private)
static void pp_irq (void *private)
{
struct pp_struct * pp = (struct pp_struct *) private;
struct pp_struct *pp = private;
if (pp->irqresponse) {
parport_write_control (pp->pdev->port, pp->irqctl);

View File

@ -79,7 +79,6 @@
#define RS_EVENT_WRITE_WAKEUP 0
static struct riscom_board * IRQ_to_board[16];
static struct tty_driver *riscom_driver;
static struct riscom_board rc_board[RC_NBOARD] = {
@ -537,16 +536,14 @@ static inline void rc_check_modem(struct riscom_board const * bp)
}
/* The main interrupt processing routine */
static irqreturn_t rc_interrupt(int irq, void * dev_id)
static irqreturn_t rc_interrupt(int dummy, void * dev_id)
{
unsigned char status;
unsigned char ack;
struct riscom_board *bp;
struct riscom_board *bp = dev_id;
unsigned long loop = 0;
int handled = 0;
bp = IRQ_to_board[irq];
if (!(bp->flags & RC_BOARD_ACTIVE))
return IRQ_NONE;
@ -603,7 +600,7 @@ static irqreturn_t rc_interrupt(int irq, void * dev_id)
*/
/* Called with disabled interrupts */
static inline int rc_setup_board(struct riscom_board * bp)
static int rc_setup_board(struct riscom_board * bp)
{
int error;
@ -611,7 +608,7 @@ static inline int rc_setup_board(struct riscom_board * bp)
return 0;
error = request_irq(bp->irq, rc_interrupt, IRQF_DISABLED,
"RISCom/8", NULL);
"RISCom/8", bp);
if (error)
return error;
@ -619,14 +616,13 @@ static inline int rc_setup_board(struct riscom_board * bp)
bp->DTR = ~0;
rc_out(bp, RC_DTR, bp->DTR); /* Drop DTR on all ports */
IRQ_to_board[bp->irq] = bp;
bp->flags |= RC_BOARD_ACTIVE;
return 0;
}
/* Called with disabled interrupts */
static inline void rc_shutdown_board(struct riscom_board *bp)
static void rc_shutdown_board(struct riscom_board *bp)
{
if (!(bp->flags & RC_BOARD_ACTIVE))
return;
@ -634,7 +630,6 @@ static inline void rc_shutdown_board(struct riscom_board *bp)
bp->flags &= ~RC_BOARD_ACTIVE;
free_irq(bp->irq, NULL);
IRQ_to_board[bp->irq] = NULL;
bp->DTR = ~0;
rc_out(bp, RC_DTR, bp->DTR); /* Drop DTR on all ports */
@ -1594,7 +1589,6 @@ static inline int rc_init_drivers(void)
if (!riscom_driver)
return -ENOMEM;
memset(IRQ_to_board, 0, sizeof(IRQ_to_board));
riscom_driver->owner = THIS_MODULE;
riscom_driver->name = "ttyL";
riscom_driver->major = RISCOM8_NORMAL_MAJOR;

View File

@ -381,7 +381,7 @@ static struct tpm_vendor_specific tpm_tis = {
static irqreturn_t tis_int_probe(int irq, void *dev_id)
{
struct tpm_chip *chip = (struct tpm_chip *) dev_id;
struct tpm_chip *chip = dev_id;
u32 interrupt;
interrupt = ioread32(chip->vendor.iobase +
@ -401,7 +401,7 @@ static irqreturn_t tis_int_probe(int irq, void *dev_id)
static irqreturn_t tis_int_handler(int irq, void *dev_id)
{
struct tpm_chip *chip = (struct tpm_chip *) dev_id;
struct tpm_chip *chip = dev_id;
u32 interrupt;
int i;

View File

@ -102,7 +102,7 @@ static int parkbd_write(struct serio *port, unsigned char c)
return 0;
}
static void parkbd_interrupt(int irq, void *dev_id)
static void parkbd_interrupt(void *dev_id)
{
if (parkbd_writing) {

View File

@ -61,7 +61,7 @@ act2000_isa_detect(unsigned short portbase)
}
static irqreturn_t
act2000_isa_interrupt(int irq, void *dev_id)
act2000_isa_interrupt(int dummy, void *dev_id)
{
act2000_card *card = dev_id;
u_char istatus;
@ -80,7 +80,7 @@ act2000_isa_interrupt(int irq, void *dev_id)
printk(KERN_WARNING "act2000: errIRQ\n");
}
if (istatus)
printk(KERN_DEBUG "act2000: ?IRQ %d %02x\n", irq, istatus);
printk(KERN_DEBUG "act2000: ?IRQ %d %02x\n", card->irq, istatus);
return IRQ_HANDLED;
}
@ -131,6 +131,8 @@ act2000_isa_enable_irq(act2000_card * card)
int
act2000_isa_config_irq(act2000_card * card, short irq)
{
int old_irq;
if (card->flags & ACT2000_FLAGS_IVALID) {
free_irq(card->irq, card);
}
@ -139,8 +141,10 @@ act2000_isa_config_irq(act2000_card * card, short irq)
if (!irq)
return 0;
if (!request_irq(irq, &act2000_isa_interrupt, 0, card->regname, card)) {
card->irq = irq;
old_irq = card->irq;
card->irq = irq;
if (request_irq(irq, &act2000_isa_interrupt, 0, card->regname, card)) {
card->irq = old_irq;
card->flags |= ACT2000_FLAGS_IVALID;
printk(KERN_WARNING
"act2000: Could not request irq %d\n",irq);

View File

@ -334,7 +334,8 @@ static int __init sc_init(void)
*/
sc_adapter[cinst]->interrupt = irq[b];
if (request_irq(sc_adapter[cinst]->interrupt, interrupt_handler,
IRQF_DISABLED, interface->id, NULL))
IRQF_DISABLED, interface->id,
(void *)(unsigned long) cinst))
{
kfree(sc_adapter[cinst]->channel);
indicate_status(cinst, ISDN_STAT_UNLOAD, 0, NULL); /* Fix me */

View File

@ -21,28 +21,15 @@
#include "card.h"
#include <linux/interrupt.h>
static int get_card_from_irq(int irq)
{
int i;
for(i = 0 ; i < cinst ; i++) {
if(sc_adapter[i]->interrupt == irq)
return i;
}
return -1;
}
/*
*
*/
irqreturn_t interrupt_handler(int interrupt, void *cardptr)
irqreturn_t interrupt_handler(int dummy, void *card_inst)
{
RspMessage rcvmsg;
int channel;
int card;
card = get_card_from_irq(interrupt);
int card = (int)(unsigned long) card_inst;
if(!IS_VALID_CARD(card)) {
pr_debug("Invalid param: %d is not a valid card id\n", card);

View File

@ -359,7 +359,7 @@ static int onenand_wait(struct mtd_info *mtd, int state)
*/
static irqreturn_t onenand_interrupt(int irq, void *data)
{
struct onenand_chip *this = (struct onenand_chip *) data;
struct onenand_chip *this = data;
/* To handle shared interrupt */
if (!this->complete.done)

View File

@ -46,8 +46,6 @@
#include <asm/semaphore.h>
#include <asm/io.h>
typedef irqreturn_t(*intr_handler_t) (int, void *);
struct vlan_group;
struct adapter;
struct sge_qset;
@ -270,7 +268,7 @@ void t3_sge_start(struct adapter *adap);
void t3_sge_stop(struct adapter *adap);
void t3_free_sge_resources(struct adapter *adap);
void t3_sge_err_intr_handler(struct adapter *adapter);
intr_handler_t t3_intr_handler(struct adapter *adap, int polling);
irq_handler_t t3_intr_handler(struct adapter *adap, int polling);
int t3_eth_xmit(struct sk_buff *skb, struct net_device *dev);
int t3_mgmt_tx(struct adapter *adap, struct sk_buff *skb);
void t3_update_qset_coalesce(struct sge_qset *qs, const struct qset_params *p);

View File

@ -2431,7 +2431,7 @@ static irqreturn_t t3b_intr_napi(int irq, void *cookie)
* (MSI-X, MSI, or legacy) and whether NAPI will be used to service the
* response queues.
*/
intr_handler_t t3_intr_handler(struct adapter *adap, int polling)
irq_handler_t t3_intr_handler(struct adapter *adap, int polling)
{
if (adap->flags & USING_MSIX)
return polling ? t3_sge_intr_msix_napi : t3_sge_intr_msix;

View File

@ -325,12 +325,6 @@ static int eppconfig(struct baycom_state *bc)
/* ---------------------------------------------------------------------- */
static void epp_interrupt(int irq, void *dev_id)
{
}
/* ---------------------------------------------------------------------- */
static inline void do_kiss_params(struct baycom_state *bc,
unsigned char *data, unsigned long len)
{
@ -871,7 +865,7 @@ static int epp_open(struct net_device *dev)
}
memset(&bc->modem, 0, sizeof(bc->modem));
bc->pdev = parport_register_device(pp, dev->name, NULL, epp_wakeup,
epp_interrupt, PARPORT_DEV_EXCL, dev);
NULL, PARPORT_DEV_EXCL, dev);
parport_put_port(pp);
if (!bc->pdev) {
printk(KERN_ERR "%s: cannot register parport at 0x%lx\n", bc_drvname, pp->base);

View File

@ -270,9 +270,9 @@ static __inline__ void par96_rx(struct net_device *dev, struct baycom_state *bc)
/* --------------------------------------------------------------------- */
static void par96_interrupt(int irq, void *dev_id)
static void par96_interrupt(void *dev_id)
{
struct net_device *dev = (struct net_device *)dev_id;
struct net_device *dev = dev_id;
struct baycom_state *bc = netdev_priv(dev);
baycom_int_freq(bc);

View File

@ -1124,12 +1124,6 @@ static irqreturn_t i596_interrupt(int irq, void *dev_id)
struct i596_dma *dma;
unsigned short status, ack_cmd = 0;
if (dev == NULL) {
printk(KERN_WARNING "%s: irq %d for unknown device.\n",
__FUNCTION__, irq);
return IRQ_NONE;
}
lp = netdev_priv(dev);
dma = lp->dma;
@ -1140,7 +1134,7 @@ static irqreturn_t i596_interrupt(int irq, void *dev_id)
DEB(DEB_INTS, printk(KERN_DEBUG
"%s: i596 interrupt, IRQ %d, status %4.4x.\n",
dev->name, irq, status));
dev->name, dev->irq, status));
ack_cmd = status & 0xf000;

View File

@ -1268,17 +1268,10 @@ netxen_handle_int(struct netxen_adapter *adapter, struct net_device *netdev)
*/
irqreturn_t netxen_intr(int irq, void *data)
{
struct netxen_adapter *adapter;
struct net_device *netdev;
struct netxen_adapter *adapter = data;
struct net_device *netdev = adapter->netdev;
u32 our_int = 0;
if (unlikely(!irq)) {
return IRQ_NONE; /* Not our interrupt */
}
adapter = (struct netxen_adapter *)data;
netdev = adapter->netdev;
if (!(adapter->flags & NETXEN_NIC_MSI_ENABLED)) {
our_int = readl(NETXEN_CRB_NORMALIZE(adapter, CRB_INT_VECTOR));
/* not our interrupt */

View File

@ -143,7 +143,7 @@ static void plip_bh(struct work_struct *work);
static void plip_timer_bh(struct work_struct *work);
/* Interrupt handler */
static void plip_interrupt(int irq, void *dev_id);
static void plip_interrupt(void *dev_id);
/* Functions for DEV methods */
static int plip_tx_packet(struct sk_buff *skb, struct net_device *dev);
@ -380,7 +380,7 @@ plip_timer_bh(struct work_struct *work)
container_of(work, struct net_local, timer.work);
if (!(atomic_read (&nl->kill_timer))) {
plip_interrupt (-1, nl->dev);
plip_interrupt (nl->dev);
schedule_delayed_work(&nl->timer, 1);
}
@ -897,7 +897,7 @@ plip_error(struct net_device *dev, struct net_local *nl,
/* Handle the parallel port interrupts. */
static void
plip_interrupt(int irq, void *dev_id)
plip_interrupt(void *dev_id)
{
struct net_device *dev = dev_id;
struct net_local *nl;

View File

@ -1801,7 +1801,7 @@ typhoon_poll(struct napi_struct *napi, int budget)
static irqreturn_t
typhoon_interrupt(int irq, void *dev_instance)
{
struct net_device *dev = (struct net_device *) dev_instance;
struct net_device *dev = dev_instance;
struct typhoon *tp = dev->priv;
void __iomem *ioaddr = tp->ioaddr;
u32 intr_status;

View File

@ -3607,7 +3607,7 @@ static int ucc_geth_poll(struct napi_struct *napi, int budget)
static irqreturn_t ucc_geth_irq_handler(int irq, void *info)
{
struct net_device *dev = (struct net_device *)info;
struct net_device *dev = info;
struct ucc_geth_private *ugeth = netdev_priv(dev);
struct ucc_fast_private *uccf;
struct ucc_geth_info *ug_info;

View File

@ -502,8 +502,8 @@ sbni_start_xmit( struct sk_buff *skb, struct net_device *dev )
static irqreturn_t
sbni_interrupt( int irq, void *dev_id )
{
struct net_device *dev = (struct net_device *) dev_id;
struct net_local *nl = (struct net_local *) dev->priv;
struct net_device *dev = dev_id;
struct net_local *nl = dev->priv;
int repeat;
spin_lock( &nl->lock );

View File

@ -199,11 +199,6 @@ void parport_daisy_fini(struct parport *port)
* parport_open - find a device by canonical device number
* @devnum: canonical device number
* @name: name to associate with the device
* @pf: preemption callback
* @kf: kick callback
* @irqf: interrupt handler
* @flags: registration flags
* @handle: driver data
*
* This function is similar to parport_register_device(), except
* that it locates a device by its number rather than by the port
@ -214,10 +209,7 @@ void parport_daisy_fini(struct parport *port)
* for parport_register_device().
**/
struct pardevice *parport_open(int devnum, const char *name,
int (*pf) (void *), void (*kf) (void *),
void (*irqf) (int, void *),
int flags, void *handle)
struct pardevice *parport_open(int devnum, const char *name)
{
struct daisydev *p = topology;
struct parport *port;
@ -237,8 +229,7 @@ struct pardevice *parport_open(int devnum, const char *name,
port = parport_get_port(p->port);
spin_unlock(&topology_lock);
dev = parport_register_device(port, name, pf, kf,
irqf, flags, handle);
dev = parport_register_device(port, name, NULL, NULL, NULL, 0, NULL);
parport_put_port(port);
if (!dev)
return NULL;

View File

@ -571,7 +571,7 @@ static int parport_ieee1284_ack_data_avail (struct parport *port)
#endif /* IEEE1284 support */
/* Handle an interrupt. */
void parport_ieee1284_interrupt (int which, void *handle)
void parport_ieee1284_interrupt (void *handle)
{
struct parport *port = handle;
parport_ieee1284_wakeup (port);

View File

@ -137,13 +137,6 @@ static unsigned char amiga_read_status(struct parport *p)
return status;
}
/* as this ports irq handling is already done, we use a generic funktion */
static irqreturn_t amiga_interrupt(int irq, void *dev_id)
{
parport_generic_irq(irq, (struct parport *) dev_id);
return IRQ_HANDLED;
}
static void amiga_enable_irq(struct parport *p)
{
enable_irq(IRQ_AMIGA_CIAA_FLG);
@ -255,7 +248,7 @@ static int __init parport_amiga_init(void)
if (!p)
goto out_port;
err = request_irq(IRQ_AMIGA_CIAA_FLG, amiga_interrupt, 0, p->name, p);
err = request_irq(IRQ_AMIGA_CIAA_FLG, parport_irq_handler, 0, p->name, p);
if (err)
goto out_irq;

View File

@ -103,13 +103,6 @@ parport_atari_restore_state(struct parport *p, struct parport_state *s)
{
}
static irqreturn_t
parport_atari_interrupt(int irq, void *dev_id)
{
parport_generic_irq(irq, (struct parport *) dev_id);
return IRQ_HANDLED;
}
static void
parport_atari_enable_irq(struct parport *p)
{
@ -208,7 +201,7 @@ static int __init parport_atari_init(void)
&parport_atari_ops);
if (!p)
return -ENODEV;
if (request_irq(IRQ_MFP_BUSY, parport_atari_interrupt,
if (request_irq(IRQ_MFP_BUSY, parport_irq_handler,
IRQ_TYPE_SLOW, p->name, p)) {
parport_put_port (p);
return -ENODEV;

View File

@ -232,14 +232,6 @@ parport_ax88796_restore_state(struct parport *p, struct parport_state *s)
writeb(s->u.ax88796.cpr, dd->spp_cpr);
}
static irqreturn_t
parport_ax88796_interrupt(int irq, void *dev_id)
{
parport_generic_irq(irq, dev_id);
return IRQ_HANDLED;
}
static struct parport_operations parport_ax88796_ops = {
.write_data = parport_ax88796_write_data,
.read_data = parport_ax88796_read_data,
@ -344,7 +336,7 @@ static int parport_ax88796_probe(struct platform_device *pdev)
if (irq >= 0) {
/* request irq */
ret = request_irq(irq, parport_ax88796_interrupt,
ret = request_irq(irq, parport_irq_handler,
IRQF_TRIGGER_FALLING, pdev->name, pp);
if (ret < 0)

View File

@ -80,12 +80,6 @@ static int clear_epp_timeout(struct parport *pb)
* of these are in parport_gsc.h.
*/
static irqreturn_t parport_gsc_interrupt(int irq, void *dev_id)
{
parport_generic_irq(irq, (struct parport *) dev_id);
return IRQ_HANDLED;
}
void parport_gsc_init_state(struct pardevice *dev, struct parport_state *s)
{
s->u.pc.ctr = 0xc | (dev->irq_func ? 0x10 : 0x0);
@ -324,7 +318,7 @@ struct parport *__devinit parport_gsc_probe_port (unsigned long base,
printk("]\n");
if (p->irq != PARPORT_IRQ_NONE) {
if (request_irq (p->irq, parport_gsc_interrupt,
if (request_irq (p->irq, parport_irq_handler,
0, p->name, p)) {
printk (KERN_WARNING "%s: irq %d in use, "
"resorting to polled operation\n",

View File

@ -778,14 +778,16 @@ static irqreturn_t parport_ip32_interrupt(int irq, void *dev_id)
struct parport * const p = dev_id;
struct parport_ip32_private * const priv = p->physport->private_data;
enum parport_ip32_irq_mode irq_mode = priv->irq_mode;
switch (irq_mode) {
case PARPORT_IP32_IRQ_FWD:
parport_generic_irq(irq, p);
break;
return parport_irq_handler(irq, dev_id);
case PARPORT_IP32_IRQ_HERE:
parport_ip32_wakeup(p);
break;
}
return IRQ_HANDLED;
}

View File

@ -219,7 +219,7 @@ static irqreturn_t mfc3_interrupt(int irq, void *dev_id)
if (this_port[i] != NULL)
if (pia(this_port[i])->crb & 128) { /* Board caused interrupt */
dummy = pia(this_port[i])->pprb; /* clear irq bit */
parport_generic_irq(irq, this_port[i]);
parport_generic_irq(this_port[i]);
}
return IRQ_HANDLED;
}

View File

@ -272,13 +272,6 @@ static int clear_epp_timeout(struct parport *pb)
* of these are in parport_pc.h.
*/
static irqreturn_t parport_pc_interrupt(int irq, void *dev_id)
{
parport_generic_irq(irq, (struct parport *) dev_id);
/* FIXME! Was it really ours? */
return IRQ_HANDLED;
}
static void parport_pc_init_state(struct pardevice *dev, struct parport_state *s)
{
s->u.pc.ctr = 0xc;
@ -2301,7 +2294,7 @@ struct parport *parport_pc_probe_port (unsigned long int base,
EPP_res = NULL;
}
if (p->irq != PARPORT_IRQ_NONE) {
if (request_irq (p->irq, parport_pc_interrupt,
if (request_irq (p->irq, parport_irq_handler,
0, p->name, p)) {
printk (KERN_WARNING "%s: irq %d in use, "
"resorting to polled operation\n",

View File

@ -46,12 +46,6 @@
#define dprintk(x)
#endif
static irqreturn_t parport_sunbpp_interrupt(int irq, void *dev_id)
{
parport_generic_irq(irq, (struct parport *) dev_id);
return IRQ_HANDLED;
}
static void parport_sunbpp_disable_irq(struct parport *p)
{
struct bpp_regs __iomem *regs = (struct bpp_regs __iomem *)p->base;
@ -324,7 +318,7 @@ static int __devinit init_one_port(struct sbus_dev *sdev)
p->size = size;
p->dev = &sdev->ofdev.dev;
if ((err = request_irq(p->irq, parport_sunbpp_interrupt,
if ((err = request_irq(p->irq, parport_irq_handler,
IRQF_SHARED, p->name, p)) != 0) {
goto out_put_port;
}

View File

@ -255,8 +255,7 @@ static ssize_t parport_read_device_id (struct parport *port, char *buffer,
ssize_t parport_device_id (int devnum, char *buffer, size_t count)
{
ssize_t retval = -ENXIO;
struct pardevice *dev = parport_open (devnum, "Device ID probe",
NULL, NULL, NULL, 0, NULL);
struct pardevice *dev = parport_open (devnum, "Device ID probe");
if (!dev)
return -ENXIO;

View File

@ -524,7 +524,7 @@ void parport_remove_port(struct parport *port)
struct pardevice *
parport_register_device(struct parport *port, const char *name,
int (*pf)(void *), void (*kf)(void *),
void (*irq_func)(int, void *),
void (*irq_func)(void *),
int flags, void *handle)
{
struct pardevice *tmp;
@ -995,6 +995,15 @@ void parport_release(struct pardevice *dev)
}
}
irqreturn_t parport_irq_handler(int irq, void *dev_id)
{
struct parport *port = dev_id;
parport_generic_irq(port);
return IRQ_HANDLED;
}
/* Exported symbols for modules. */
EXPORT_SYMBOL(parport_claim);
@ -1011,5 +1020,6 @@ EXPORT_SYMBOL(parport_get_port);
EXPORT_SYMBOL(parport_put_port);
EXPORT_SYMBOL(parport_find_number);
EXPORT_SYMBOL(parport_find_base);
EXPORT_SYMBOL(parport_irq_handler);
MODULE_LICENSE("GPL");

View File

@ -128,7 +128,7 @@ static void async_complete(struct urb *urb)
#endif
/* if nAck interrupts are enabled and we have an interrupt, call the interrupt procedure */
if (rq->reg[2] & rq->reg[1] & 0x10 && pp)
parport_generic_irq(0, pp);
parport_generic_irq(pp);
}
complete(&rq->compl);
kref_put(&rq->ref_count, destroy_async);
@ -337,7 +337,7 @@ static int uss720_irq(int usbstatus, void *buffer, int len, void *dev_id)
memcpy(priv->reg, buffer, 4);
/* if nAck interrupts are enabled and we have an interrupt, call the interrupt procedure */
if (priv->reg[2] & priv->reg[1] & 0x10)
parport_generic_irq(0, pp);
parport_generic_irq(pp);
return 1;
}
#endif

View File

@ -100,6 +100,7 @@ typedef enum {
#include <linux/proc_fs.h>
#include <linux/spinlock.h>
#include <linux/wait.h>
#include <linux/irqreturn.h>
#include <asm/system.h>
#include <asm/ptrace.h>
#include <asm/semaphore.h>
@ -229,7 +230,7 @@ struct pardevice {
int (*preempt)(void *);
void (*wakeup)(void *);
void *private;
void (*irq_func)(int, void *);
void (*irq_func)(void *);
unsigned int flags;
struct pardevice *next;
struct pardevice *prev;
@ -366,6 +367,9 @@ extern void parport_unregister_driver (struct parport_driver *);
extern struct parport *parport_find_number (int);
extern struct parport *parport_find_base (unsigned long);
/* generic irq handler, if it suits your needs */
extern irqreturn_t parport_irq_handler(int irq, void *dev_id);
/* Reference counting for ports. */
extern struct parport *parport_get_port (struct parport *);
extern void parport_put_port (struct parport *);
@ -379,7 +383,7 @@ extern void parport_put_port (struct parport *);
struct pardevice *parport_register_device(struct parport *port,
const char *name,
int (*pf)(void *), void (*kf)(void *),
void (*irq_func)(int, void *),
void (*irq_func)(void *),
int flags, void *handle);
/* parport_unregister unlinks a device from the chain. */
@ -461,7 +465,7 @@ static __inline__ int parport_yield_blocking(struct pardevice *dev)
#define PARPORT_FLAG_EXCL (1<<1) /* EXCL driver registered. */
/* IEEE1284 functions */
extern void parport_ieee1284_interrupt (int, void *);
extern void parport_ieee1284_interrupt (void *);
extern int parport_negotiate (struct parport *, int mode);
extern ssize_t parport_write (struct parport *, const void *buf, size_t len);
extern ssize_t parport_read (struct parport *, void *buf, size_t len);
@ -503,23 +507,19 @@ extern size_t parport_ieee1284_epp_read_addr (struct parport *,
/* IEEE1284.3 functions */
extern int parport_daisy_init (struct parport *port);
extern void parport_daisy_fini (struct parport *port);
extern struct pardevice *parport_open (int devnum, const char *name,
int (*pf) (void *),
void (*kf) (void *),
void (*irqf) (int, void *),
int flags, void *handle);
extern struct pardevice *parport_open (int devnum, const char *name);
extern void parport_close (struct pardevice *dev);
extern ssize_t parport_device_id (int devnum, char *buffer, size_t len);
extern void parport_daisy_deselect_all (struct parport *port);
extern int parport_daisy_select (struct parport *port, int daisy, int mode);
/* Lowlevel drivers _can_ call this support function to handle irqs. */
static __inline__ void parport_generic_irq(int irq, struct parport *port)
static inline void parport_generic_irq(struct parport *port)
{
parport_ieee1284_interrupt (irq, port);
parport_ieee1284_interrupt (port);
read_lock(&port->cad_lock);
if (port->cad && port->cad->irq_func)
port->cad->irq_func(irq, port->cad->private);
port->cad->irq_func(port->cad->private);
read_unlock(&port->cad_lock);
}

View File

@ -830,7 +830,7 @@ static int __devinit snd_mts64_rawmidi_create(struct snd_card *card)
/*********************************************************************
* parport stuff
*********************************************************************/
static void snd_mts64_interrupt(int irq, void *private)
static void snd_mts64_interrupt(void *private)
{
struct mts64 *mts = ((struct snd_card*)private)->private_data;
u16 ret;

View File

@ -611,7 +611,7 @@ static int __devinit snd_portman_rawmidi_create(struct snd_card *card)
/*********************************************************************
* parport stuff
*********************************************************************/
static void snd_portman_interrupt(int irq, void *userdata)
static void snd_portman_interrupt(void *userdata)
{
unsigned char midivalue = 0;
struct portman *pm = ((struct snd_card*)userdata)->private_data;