Commit a6f97b29 authored by Jeff Garzik's avatar Jeff Garzik Committed by Jeff Garzik

drivers/char: minor irq handler cleanups

- remove always-false tests

- don't overload 'irq' argument, pass data properly via dev_id

- remove pointless casts from void*
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent e8f39549
...@@ -97,20 +97,24 @@ static void EnableSRAM(THINKPAD_BD_DATA * pBDData) ...@@ -97,20 +97,24 @@ static void EnableSRAM(THINKPAD_BD_DATA * pBDData)
static irqreturn_t UartInterrupt(int irq, void *dev_id) static irqreturn_t UartInterrupt(int irq, void *dev_id)
{ {
int irqno = (int)(unsigned long) dev_id;
PRINTK_3(TRACE_TP3780I, PRINTK_3(TRACE_TP3780I,
"tp3780i::UartInterrupt entry irq %x dev_id %p\n", irq, dev_id); "tp3780i::UartInterrupt entry irq %x dev_id %p\n", irqno, dev_id);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
static irqreturn_t DspInterrupt(int irq, void *dev_id) static irqreturn_t DspInterrupt(int irq, void *dev_id)
{ {
int irqno = (int)(unsigned long) dev_id;
pMWAVE_DEVICE_DATA pDrvData = &mwave_s_mdd; pMWAVE_DEVICE_DATA pDrvData = &mwave_s_mdd;
DSP_3780I_CONFIG_SETTINGS *pSettings = &pDrvData->rBDData.rDspSettings; DSP_3780I_CONFIG_SETTINGS *pSettings = &pDrvData->rBDData.rDspSettings;
unsigned short usDspBaseIO = pSettings->usDspBaseIO; unsigned short usDspBaseIO = pSettings->usDspBaseIO;
unsigned short usIPCSource = 0, usIsolationMask, usPCNum; unsigned short usIPCSource = 0, usIsolationMask, usPCNum;
PRINTK_3(TRACE_TP3780I, PRINTK_3(TRACE_TP3780I,
"tp3780i::DspInterrupt entry irq %x dev_id %p\n", irq, dev_id); "tp3780i::DspInterrupt entry irq %x dev_id %p\n", irqno, dev_id);
if (dsp3780I_GetIPCSource(usDspBaseIO, &usIPCSource) == 0) { if (dsp3780I_GetIPCSource(usDspBaseIO, &usIPCSource) == 0) {
PRINTK_2(TRACE_TP3780I, PRINTK_2(TRACE_TP3780I,
...@@ -361,14 +365,16 @@ int tp3780I_EnableDSP(THINKPAD_BD_DATA * pBDData) ...@@ -361,14 +365,16 @@ int tp3780I_EnableDSP(THINKPAD_BD_DATA * pBDData)
pSettings->bPllBypass = TP_CFG_PllBypass; pSettings->bPllBypass = TP_CFG_PllBypass;
pSettings->usChipletEnable = TP_CFG_ChipletEnable; pSettings->usChipletEnable = TP_CFG_ChipletEnable;
if (request_irq(pSettings->usUartIrq, &UartInterrupt, 0, "mwave_uart", NULL)) { if (request_irq(pSettings->usUartIrq, &UartInterrupt, 0, "mwave_uart",
(void *)(unsigned long) pSettings->usUartIrq)) {
PRINTK_ERROR(KERN_ERR_MWAVE "tp3780i::tp3780I_EnableDSP: Error: Could not get UART IRQ %x\n", pSettings->usUartIrq); PRINTK_ERROR(KERN_ERR_MWAVE "tp3780i::tp3780I_EnableDSP: Error: Could not get UART IRQ %x\n", pSettings->usUartIrq);
goto exit_cleanup; goto exit_cleanup;
} else { /* no conflict just release */ } else { /* no conflict just release */
free_irq(pSettings->usUartIrq, NULL); free_irq(pSettings->usUartIrq, NULL);
} }
if (request_irq(pSettings->usDspIrq, &DspInterrupt, 0, "mwave_3780i", NULL)) { if (request_irq(pSettings->usDspIrq, &DspInterrupt, 0, "mwave_3780i",
(void *)(unsigned long) pSettings->usDspIrq)) {
PRINTK_ERROR("tp3780i::tp3780I_EnableDSP: Error: Could not get 3780i IRQ %x\n", pSettings->usDspIrq); PRINTK_ERROR("tp3780i::tp3780I_EnableDSP: Error: Could not get 3780i IRQ %x\n", pSettings->usDspIrq);
goto exit_cleanup; goto exit_cleanup;
} else { } else {
......
...@@ -1225,17 +1225,15 @@ static void ri_change(MGSLPC_INFO *info) ...@@ -1225,17 +1225,15 @@ static void ri_change(MGSLPC_INFO *info)
* irq interrupt number that caused interrupt * irq interrupt number that caused interrupt
* dev_id device ID supplied during interrupt registration * dev_id device ID supplied during interrupt registration
*/ */
static irqreturn_t mgslpc_isr(int irq, void *dev_id) static irqreturn_t mgslpc_isr(int dummy, void *dev_id)
{ {
MGSLPC_INFO * info = (MGSLPC_INFO *)dev_id; MGSLPC_INFO *info = dev_id;
unsigned short isr; unsigned short isr;
unsigned char gis, pis; unsigned char gis, pis;
int count=0; int count=0;
if (debug_level >= DEBUG_LEVEL_ISR) if (debug_level >= DEBUG_LEVEL_ISR)
printk("mgslpc_isr(%d) entry.\n", irq); printk("mgslpc_isr(%d) entry.\n", info->irq_level);
if (!info)
return IRQ_NONE;
if (!(info->p_dev->_locked)) if (!(info->p_dev->_locked))
return IRQ_HANDLED; return IRQ_HANDLED;
...@@ -1327,7 +1325,7 @@ static irqreturn_t mgslpc_isr(int irq, void *dev_id) ...@@ -1327,7 +1325,7 @@ static irqreturn_t mgslpc_isr(int irq, void *dev_id)
if (debug_level >= DEBUG_LEVEL_ISR) if (debug_level >= DEBUG_LEVEL_ISR)
printk("%s(%d):mgslpc_isr(%d)exit.\n", printk("%s(%d):mgslpc_isr(%d)exit.\n",
__FILE__,__LINE__,irq); __FILE__, __LINE__, info->irq_level);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
......
...@@ -443,8 +443,7 @@ void missed_irq (unsigned long data) ...@@ -443,8 +443,7 @@ void missed_irq (unsigned long data)
spin_unlock_irqrestore(&bp->lock, flags); spin_unlock_irqrestore(&bp->lock, flags);
if (irq) { if (irq) {
printk (KERN_INFO "Missed interrupt... Calling int from timer. \n"); printk (KERN_INFO "Missed interrupt... Calling int from timer. \n");
sx_interrupt (((struct specialix_board *)data)->irq, sx_interrupt (-1, bp);
(void*)data);
} }
mod_timer(&missed_irq_timer, jiffies + sx_poll); mod_timer(&missed_irq_timer, jiffies + sx_poll);
} }
...@@ -862,23 +861,22 @@ static inline void sx_check_modem(struct specialix_board * bp) ...@@ -862,23 +861,22 @@ static inline void sx_check_modem(struct specialix_board * bp)
/* The main interrupt processing routine */ /* The main interrupt processing routine */
static irqreturn_t sx_interrupt(int irq, void *dev_id) static irqreturn_t sx_interrupt(int dummy, void *dev_id)
{ {
unsigned char status; unsigned char status;
unsigned char ack; unsigned char ack;
struct specialix_board *bp; struct specialix_board *bp = dev_id;
unsigned long loop = 0; unsigned long loop = 0;
int saved_reg; int saved_reg;
unsigned long flags; unsigned long flags;
func_enter(); func_enter();
bp = dev_id;
spin_lock_irqsave(&bp->lock, flags); spin_lock_irqsave(&bp->lock, flags);
dprintk (SX_DEBUG_FLOW, "enter %s port %d room: %ld\n", __FUNCTION__, port_No(sx_get_port(bp, "INT")), SERIAL_XMIT_SIZE - sx_get_port(bp, "ITN")->xmit_cnt - 1); dprintk (SX_DEBUG_FLOW, "enter %s port %d room: %ld\n", __FUNCTION__, port_No(sx_get_port(bp, "INT")), SERIAL_XMIT_SIZE - sx_get_port(bp, "ITN")->xmit_cnt - 1);
if (!(bp->flags & SX_BOARD_ACTIVE)) { if (!(bp->flags & SX_BOARD_ACTIVE)) {
dprintk (SX_DEBUG_IRQ, "sx: False interrupt. irq %d.\n", irq); dprintk (SX_DEBUG_IRQ, "sx: False interrupt. irq %d.\n", bp->irq);
spin_unlock_irqrestore(&bp->lock, flags); spin_unlock_irqrestore(&bp->lock, flags);
func_exit(); func_exit();
return IRQ_NONE; return IRQ_NONE;
......
...@@ -1645,7 +1645,7 @@ static irqreturn_t stl_intr(int irq, void *dev_id) ...@@ -1645,7 +1645,7 @@ static irqreturn_t stl_intr(int irq, void *dev_id)
{ {
struct stlbrd *brdp = dev_id; struct stlbrd *brdp = dev_id;
pr_debug("stl_intr(brdp=%p,irq=%d)\n", brdp, irq); pr_debug("stl_intr(brdp=%p,irq=%d)\n", brdp, brdp->irq);
return IRQ_RETVAL((* brdp->isr)(brdp)); return IRQ_RETVAL((* brdp->isr)(brdp));
} }
......
...@@ -1695,20 +1695,16 @@ static void mgsl_isr_transmit_dma( struct mgsl_struct *info ) ...@@ -1695,20 +1695,16 @@ static void mgsl_isr_transmit_dma( struct mgsl_struct *info )
* *
* Return Value: None * Return Value: None
*/ */
static irqreturn_t mgsl_interrupt(int irq, void *dev_id) static irqreturn_t mgsl_interrupt(int dummy, void *dev_id)
{ {
struct mgsl_struct * info; struct mgsl_struct *info = dev_id;
u16 UscVector; u16 UscVector;
u16 DmaVector; u16 DmaVector;
if ( debug_level >= DEBUG_LEVEL_ISR ) if ( debug_level >= DEBUG_LEVEL_ISR )
printk("%s(%d):mgsl_interrupt(%d)entry.\n", printk(KERN_DEBUG "%s(%d):mgsl_interrupt(%d)entry.\n",
__FILE__,__LINE__,irq); __FILE__, __LINE__, info->irq_level);
info = (struct mgsl_struct *)dev_id;
if (!info)
return IRQ_NONE;
spin_lock(&info->irq_spinlock); spin_lock(&info->irq_spinlock);
for(;;) { for(;;) {
...@@ -1732,8 +1728,8 @@ static irqreturn_t mgsl_interrupt(int irq, void *dev_id) ...@@ -1732,8 +1728,8 @@ static irqreturn_t mgsl_interrupt(int irq, void *dev_id)
mgsl_isr_receive_dma(info); mgsl_isr_receive_dma(info);
if ( info->isr_overflow ) { if ( info->isr_overflow ) {
printk(KERN_ERR"%s(%d):%s isr overflow irq=%d\n", printk(KERN_ERR "%s(%d):%s isr overflow irq=%d\n",
__FILE__,__LINE__,info->device_name, irq); __FILE__, __LINE__, info->device_name, info->irq_level);
usc_DisableMasterIrqBit(info); usc_DisableMasterIrqBit(info);
usc_DisableDmaInterrupts(info,DICR_MASTER); usc_DisableDmaInterrupts(info,DICR_MASTER);
break; break;
...@@ -1755,8 +1751,9 @@ static irqreturn_t mgsl_interrupt(int irq, void *dev_id) ...@@ -1755,8 +1751,9 @@ static irqreturn_t mgsl_interrupt(int irq, void *dev_id)
spin_unlock(&info->irq_spinlock); spin_unlock(&info->irq_spinlock);
if ( debug_level >= DEBUG_LEVEL_ISR ) if ( debug_level >= DEBUG_LEVEL_ISR )
printk("%s(%d):mgsl_interrupt(%d)exit.\n", printk(KERN_DEBUG "%s(%d):mgsl_interrupt(%d)exit.\n",
__FILE__,__LINE__,irq); __FILE__, __LINE__, info->irq_level);
return IRQ_HANDLED; return IRQ_HANDLED;
} /* end of mgsl_interrupt() */ } /* end of mgsl_interrupt() */
......
...@@ -491,7 +491,6 @@ static void isr_serial(struct slgt_info *info); ...@@ -491,7 +491,6 @@ static void isr_serial(struct slgt_info *info);
static void isr_rdma(struct slgt_info *info); static void isr_rdma(struct slgt_info *info);
static void isr_txeom(struct slgt_info *info, unsigned short status); static void isr_txeom(struct slgt_info *info, unsigned short status);
static void isr_tdma(struct slgt_info *info); static void isr_tdma(struct slgt_info *info);
static irqreturn_t slgt_interrupt(int irq, void *dev_id);
static int alloc_dma_bufs(struct slgt_info *info); static int alloc_dma_bufs(struct slgt_info *info);
static void free_dma_bufs(struct slgt_info *info); static void free_dma_bufs(struct slgt_info *info);
...@@ -2326,17 +2325,13 @@ static void isr_gpio(struct slgt_info *info, unsigned int changed, unsigned int ...@@ -2326,17 +2325,13 @@ static void isr_gpio(struct slgt_info *info, unsigned int changed, unsigned int
* irq interrupt number * irq interrupt number
* dev_id device ID supplied during interrupt registration * dev_id device ID supplied during interrupt registration
*/ */
static irqreturn_t slgt_interrupt(int irq, void *dev_id) static irqreturn_t slgt_interrupt(int dummy, void *dev_id)
{ {
struct slgt_info *info; struct slgt_info *info = dev_id;
unsigned int gsr; unsigned int gsr;
unsigned int i; unsigned int i;
DBGISR(("slgt_interrupt irq=%d entry\n", irq)); DBGISR(("slgt_interrupt irq=%d entry\n", info->irq_level));
info = dev_id;
if (!info)
return IRQ_NONE;
spin_lock(&info->lock); spin_lock(&info->lock);
...@@ -2385,7 +2380,7 @@ static irqreturn_t slgt_interrupt(int irq, void *dev_id) ...@@ -2385,7 +2380,7 @@ static irqreturn_t slgt_interrupt(int irq, void *dev_id)
spin_unlock(&info->lock); spin_unlock(&info->lock);
DBGISR(("slgt_interrupt irq=%d exit\n", irq)); DBGISR(("slgt_interrupt irq=%d exit\n", info->irq_level));
return IRQ_HANDLED; return IRQ_HANDLED;
} }
......
...@@ -2586,9 +2586,9 @@ void isr_io_pin( SLMP_INFO *info, u16 status ) ...@@ -2586,9 +2586,9 @@ void isr_io_pin( SLMP_INFO *info, u16 status )
* dev_id device ID supplied during interrupt registration * dev_id device ID supplied during interrupt registration
* regs interrupted processor context * regs interrupted processor context
*/ */
static irqreturn_t synclinkmp_interrupt(int irq, void *dev_id) static irqreturn_t synclinkmp_interrupt(int dummy, void *dev_id)
{ {
SLMP_INFO * info; SLMP_INFO *info = dev_id;
unsigned char status, status0, status1=0; unsigned char status, status0, status1=0;
unsigned char dmastatus, dmastatus0, dmastatus1=0; unsigned char dmastatus, dmastatus0, dmastatus1=0;
unsigned char timerstatus0, timerstatus1=0; unsigned char timerstatus0, timerstatus1=0;
...@@ -2597,12 +2597,8 @@ static irqreturn_t synclinkmp_interrupt(int irq, void *dev_id) ...@@ -2597,12 +2597,8 @@ static irqreturn_t synclinkmp_interrupt(int irq, void *dev_id)
unsigned short tmp; unsigned short tmp;
if ( debug_level >= DEBUG_LEVEL_ISR ) if ( debug_level >= DEBUG_LEVEL_ISR )
printk("%s(%d): synclinkmp_interrupt(%d)entry.\n", printk(KERN_DEBUG "%s(%d): synclinkmp_interrupt(%d)entry.\n",
__FILE__,__LINE__,irq); __FILE__, __LINE__, info->irq_level);
info = (SLMP_INFO *)dev_id;
if (!info)
return IRQ_NONE;
spin_lock(&info->lock); spin_lock(&info->lock);
...@@ -2615,9 +2611,9 @@ static irqreturn_t synclinkmp_interrupt(int irq, void *dev_id) ...@@ -2615,9 +2611,9 @@ static irqreturn_t synclinkmp_interrupt(int irq, void *dev_id)
timerstatus0 = read_reg(info, ISR2); timerstatus0 = read_reg(info, ISR2);
if ( debug_level >= DEBUG_LEVEL_ISR ) if ( debug_level >= DEBUG_LEVEL_ISR )
printk("%s(%d):%s status0=%02x, dmastatus0=%02x, timerstatus0=%02x\n", printk(KERN_DEBUG "%s(%d):%s status0=%02x, dmastatus0=%02x, timerstatus0=%02x\n",
__FILE__,__LINE__,info->device_name, __FILE__, __LINE__, info->device_name,
status0,dmastatus0,timerstatus0); status0, dmastatus0, timerstatus0);
if (info->port_count == 4) { if (info->port_count == 4) {
/* get status for SCA1 (ports 2-3) */ /* get status for SCA1 (ports 2-3) */
...@@ -2702,8 +2698,8 @@ static irqreturn_t synclinkmp_interrupt(int irq, void *dev_id) ...@@ -2702,8 +2698,8 @@ static irqreturn_t synclinkmp_interrupt(int irq, void *dev_id)
spin_unlock(&info->lock); spin_unlock(&info->lock);
if ( debug_level >= DEBUG_LEVEL_ISR ) if ( debug_level >= DEBUG_LEVEL_ISR )
printk("%s(%d):synclinkmp_interrupt(%d)exit.\n", printk(KERN_DEBUG "%s(%d):synclinkmp_interrupt(%d)exit.\n",
__FILE__,__LINE__,irq); __FILE__, __LINE__, info->irq_level);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
......
...@@ -399,7 +399,7 @@ static irqreturn_t tis_int_probe(int irq, void *dev_id) ...@@ -399,7 +399,7 @@ static irqreturn_t tis_int_probe(int irq, void *dev_id)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
static irqreturn_t tis_int_handler(int irq, void *dev_id) static irqreturn_t tis_int_handler(int dummy, void *dev_id)
{ {
struct tpm_chip *chip = dev_id; struct tpm_chip *chip = dev_id;
u32 interrupt; u32 interrupt;
......
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