diff options
author | Jeff Garzik <jeff@garzik.org> | 2007-10-29 05:46:16 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:03:40 -0500 |
commit | 28fc1f5a0c375cb6375fa48e9a8b393f2a189be6 (patch) | |
tree | 95b3b517b02dd46ff0fc2728c1e70de8d6f78ed3 /drivers/net/irda | |
parent | 1b36efe07f83ecf50eddd431d067c7bf86318e87 (diff) |
[netdrvr] irq handler minor cleanups in several drivers
* use irq_handler_t where appropriate
* no need to use 'irq' function arg, its already stored in a data struct
* rename irq handler 'irq' argument to 'dummy', where the function
has been analyzed and proven not to use its first argument.
* remove always-false "dev_id == NULL" test from irq handlers
* remove pointless casts from void*
* declance: irq argument is not const
* add KERN_xxx printk prefix
* fix minor whitespace weirdness
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/irda')
-rw-r--r-- | drivers/net/irda/irport.h | 2 | ||||
-rw-r--r-- | drivers/net/irda/smsc-ircc2.c | 17 | ||||
-rw-r--r-- | drivers/net/irda/via-ircc.c | 12 |
3 files changed, 8 insertions, 23 deletions
diff --git a/drivers/net/irda/irport.h b/drivers/net/irda/irport.h index 66fc2433e97d..39829cffba13 100644 --- a/drivers/net/irda/irport.h +++ b/drivers/net/irda/irport.h | |||
@@ -74,7 +74,7 @@ struct irport_cb { | |||
74 | /* For piggyback drivers */ | 74 | /* For piggyback drivers */ |
75 | void *priv; | 75 | void *priv; |
76 | void (*change_speed)(void *priv, __u32 speed); | 76 | void (*change_speed)(void *priv, __u32 speed); |
77 | irqreturn_t (*interrupt)(int irq, void *dev_id); | 77 | irq_handler_t interrupt; |
78 | }; | 78 | }; |
79 | 79 | ||
80 | #endif /* IRPORT_H */ | 80 | #endif /* IRPORT_H */ |
diff --git a/drivers/net/irda/smsc-ircc2.c b/drivers/net/irda/smsc-ircc2.c index 7e7b5828214a..1f26da761e9f 100644 --- a/drivers/net/irda/smsc-ircc2.c +++ b/drivers/net/irda/smsc-ircc2.c | |||
@@ -1505,22 +1505,13 @@ static void smsc_ircc_sir_receive(struct smsc_ircc_cb *self) | |||
1505 | * An interrupt from the chip has arrived. Time to do some work | 1505 | * An interrupt from the chip has arrived. Time to do some work |
1506 | * | 1506 | * |
1507 | */ | 1507 | */ |
1508 | static irqreturn_t smsc_ircc_interrupt(int irq, void *dev_id) | 1508 | static irqreturn_t smsc_ircc_interrupt(int dummy, void *dev_id) |
1509 | { | 1509 | { |
1510 | struct net_device *dev = (struct net_device *) dev_id; | 1510 | struct net_device *dev = dev_id; |
1511 | struct smsc_ircc_cb *self; | 1511 | struct smsc_ircc_cb *self = netdev_priv(dev); |
1512 | int iobase, iir, lcra, lsr; | 1512 | int iobase, iir, lcra, lsr; |
1513 | irqreturn_t ret = IRQ_NONE; | 1513 | irqreturn_t ret = IRQ_NONE; |
1514 | 1514 | ||
1515 | if (dev == NULL) { | ||
1516 | printk(KERN_WARNING "%s: irq %d for unknown device.\n", | ||
1517 | driver_name, irq); | ||
1518 | goto irq_ret; | ||
1519 | } | ||
1520 | |||
1521 | self = netdev_priv(dev); | ||
1522 | IRDA_ASSERT(self != NULL, return IRQ_NONE;); | ||
1523 | |||
1524 | /* Serialise the interrupt handler in various CPUs, stop Tx path */ | 1515 | /* Serialise the interrupt handler in various CPUs, stop Tx path */ |
1525 | spin_lock(&self->lock); | 1516 | spin_lock(&self->lock); |
1526 | 1517 | ||
@@ -1565,7 +1556,7 @@ static irqreturn_t smsc_ircc_interrupt(int irq, void *dev_id) | |||
1565 | 1556 | ||
1566 | irq_ret_unlock: | 1557 | irq_ret_unlock: |
1567 | spin_unlock(&self->lock); | 1558 | spin_unlock(&self->lock); |
1568 | irq_ret: | 1559 | |
1569 | return ret; | 1560 | return ret; |
1570 | } | 1561 | } |
1571 | 1562 | ||
diff --git a/drivers/net/irda/via-ircc.c b/drivers/net/irda/via-ircc.c index 126ec7c8680e..58e128784585 100644 --- a/drivers/net/irda/via-ircc.c +++ b/drivers/net/irda/via-ircc.c | |||
@@ -1346,19 +1346,13 @@ static int RxTimerHandler(struct via_ircc_cb *self, int iobase) | |||
1346 | * An interrupt from the chip has arrived. Time to do some work | 1346 | * An interrupt from the chip has arrived. Time to do some work |
1347 | * | 1347 | * |
1348 | */ | 1348 | */ |
1349 | static irqreturn_t via_ircc_interrupt(int irq, void *dev_id) | 1349 | static irqreturn_t via_ircc_interrupt(int dummy, void *dev_id) |
1350 | { | 1350 | { |
1351 | struct net_device *dev = (struct net_device *) dev_id; | 1351 | struct net_device *dev = dev_id; |
1352 | struct via_ircc_cb *self; | 1352 | struct via_ircc_cb *self = dev->priv; |
1353 | int iobase; | 1353 | int iobase; |
1354 | u8 iHostIntType, iRxIntType, iTxIntType; | 1354 | u8 iHostIntType, iRxIntType, iTxIntType; |
1355 | 1355 | ||
1356 | if (!dev) { | ||
1357 | IRDA_WARNING("%s: irq %d for unknown device.\n", driver_name, | ||
1358 | irq); | ||
1359 | return IRQ_NONE; | ||
1360 | } | ||
1361 | self = (struct via_ircc_cb *) dev->priv; | ||
1362 | iobase = self->io.fir_base; | 1356 | iobase = self->io.fir_base; |
1363 | spin_lock(&self->lock); | 1357 | spin_lock(&self->lock); |
1364 | iHostIntType = GetHostStatus(iobase); | 1358 | iHostIntType = GetHostStatus(iobase); |