git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git]
/
drivers
/
net
/
irda
/
irport.c
diff --git
a/drivers/net/irda/irport.c
b/drivers/net/irda/irport.c
index
5971315
..
3098960
100644
(file)
--- a/
drivers/net/irda/irport.c
+++ b/
drivers/net/irda/irport.c
@@
-87,8
+87,7
@@
static struct net_device_stats *irport_net_get_stats(struct net_device *dev);
static int irport_change_speed_complete(struct irda_task *task);
static void irport_timeout(struct net_device *dev);
static int irport_change_speed_complete(struct irda_task *task);
static void irport_timeout(struct net_device *dev);
-static irqreturn_t irport_interrupt(int irq, void *dev_id,
- struct pt_regs *regs);
+static irqreturn_t irport_interrupt(int irq, void *dev_id);
static int irport_hard_xmit(struct sk_buff *skb, struct net_device *dev);
static void irport_change_speed(void *priv, __u32 speed);
static int irport_net_open(struct net_device *dev);
static int irport_hard_xmit(struct sk_buff *skb, struct net_device *dev);
static void irport_change_speed(void *priv, __u32 speed);
static int irport_net_open(struct net_device *dev);
@@
-165,7
+164,7
@@
irport_open(int i, unsigned int iobase, unsigned int irq)
/* Allocate memory if needed */
if (self->tx_buff.truesize > 0) {
/* Allocate memory if needed */
if (self->tx_buff.truesize > 0) {
- self->tx_buff.head =
(__u8 *) kmalloc(self->tx_buff.truesize,
+ self->tx_buff.head =
kmalloc(self->tx_buff.truesize,
GFP_KERNEL);
if (self->tx_buff.head == NULL) {
IRDA_ERROR("%s(), can't allocate memory for "
GFP_KERNEL);
if (self->tx_buff.head == NULL) {
IRDA_ERROR("%s(), can't allocate memory for "
@@
-235,8
+234,7
@@
static int irport_close(struct irport_cb *self)
__FUNCTION__, self->io.sir_base);
release_region(self->io.sir_base, self->io.sir_ext);
__FUNCTION__, self->io.sir_base);
release_region(self->io.sir_base, self->io.sir_ext);
- if (self->tx_buff.head)
- kfree(self->tx_buff.head);
+ kfree(self->tx_buff.head);
if (self->rx_buff.skb)
kfree_skb(self->rx_buff.skb);
if (self->rx_buff.skb)
kfree_skb(self->rx_buff.skb);
@@
-285,19
+283,6
@@
static void irport_start(struct irport_cb *self)
outb(UART_IER_RLSI | UART_IER_RDI |UART_IER_THRI, iobase+UART_IER);
}
outb(UART_IER_RLSI | UART_IER_RDI |UART_IER_THRI, iobase+UART_IER);
}
-/*
- * Function irport_probe (void)
- *
- * Start IO port
- *
- */
-int irport_probe(int iobase)
-{
- IRDA_DEBUG(4, "%s(), iobase=%#x\n", __FUNCTION__, iobase);
-
- return 0;
-}
-
/*
* Function irport_get_fcr (speed)
*
/*
* Function irport_get_fcr (speed)
*
@@
-383,7
+368,7
@@
static void irport_change_speed(void *priv, __u32 speed)
* we cannot use schedule_timeout() when we are in interrupt context
*
*/
* we cannot use schedule_timeout() when we are in interrupt context
*
*/
-int __irport_change_speed(struct irda_task *task)
+
static
int __irport_change_speed(struct irda_task *task)
{
struct irport_cb *self;
__u32 speed = (__u32) task->param;
{
struct irport_cb *self;
__u32 speed = (__u32) task->param;
@@
-400,7
+385,7
@@
int __irport_change_speed(struct irda_task *task)
/* Locking notes : this function may be called from irq context with
* spinlock, via irport_write_wakeup(), or from non-interrupt without
* spinlock (from the task timer). Yuck !
/* Locking notes : this function may be called from irq context with
* spinlock, via irport_write_wakeup(), or from non-interrupt without
* spinlock (from the task timer). Yuck !
- * This is ugly, and unsafe is the spinlock is not already aquired.
+ * This is ugly, and unsafe is the spinlock is not already a
c
quired.
* This will be fixed when irda-task get rewritten.
* Jean II */
if (!spin_is_locked(&self->lock)) {
* This will be fixed when irda-task get rewritten.
* Jean II */
if (!spin_is_locked(&self->lock)) {
@@
-775,25
+760,20
@@
static inline void irport_receive(struct irport_cb *self)
}
/*
}
/*
- * Function irport_interrupt (irq, dev_id
, regs
)
+ * Function irport_interrupt (irq, dev_id)
*
* Interrupt handler
*/
*
* Interrupt handler
*/
-static irqreturn_t irport_interrupt(int irq, void *dev_id,
- struct pt_regs *regs)
+static irqreturn_t irport_interrupt(int irq, void *dev_id)
{
{
- struct net_device *dev =
(struct net_device *)
dev_id;
+ struct net_device *dev = dev_id;
struct irport_cb *self;
int boguscount = 0;
int iobase;
int iir, lsr;
int handled = 0;
struct irport_cb *self;
int boguscount = 0;
int iobase;
int iir, lsr;
int handled = 0;
- if (!dev) {
- IRDA_WARNING("%s() irq %d for unknown device.\n", __FUNCTION__, irq);
- return IRQ_NONE;
- }
- self = (struct irport_cb *) dev->priv;
+ self = dev->priv;
spin_lock(&self->lock);
spin_lock(&self->lock);
@@
-1104,7
+1084,7
@@
static int __init irport_init(void)
{
int i;
{
int i;
- for (i=0; (io[i] < 2000) && (i <
4
); i++) {
+ for (i=0; (io[i] < 2000) && (i <
ARRAY_SIZE(dev_self)
); i++) {
if (irport_open(i, io[i], irq[i]) != NULL)
return 0;
}
if (irport_open(i, io[i], irq[i]) != NULL)
return 0;
}
@@
-1126,15
+1106,15
@@
static void __exit irport_cleanup(void)
IRDA_DEBUG( 4, "%s()\n", __FUNCTION__);
IRDA_DEBUG( 4, "%s()\n", __FUNCTION__);
- for (i=0; i <
4
; i++) {
+ for (i=0; i <
ARRAY_SIZE(dev_self)
; i++) {
if (dev_self[i])
irport_close(dev_self[i]);
}
}
if (dev_self[i])
irport_close(dev_self[i]);
}
}
-
MODULE_PARM(io, "1-4i"
);
+
module_param_array(io, int, NULL, 0
);
MODULE_PARM_DESC(io, "Base I/O addresses");
MODULE_PARM_DESC(io, "Base I/O addresses");
-
MODULE_PARM(irq, "1-4i"
);
+
module_param_array(irq, int, NULL, 0
);
MODULE_PARM_DESC(irq, "IRQ lines");
MODULE_AUTHOR("Dag Brattli <dagb@cs.uit.no>");
MODULE_PARM_DESC(irq, "IRQ lines");
MODULE_AUTHOR("Dag Brattli <dagb@cs.uit.no>");