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
/
sbus
/
char
/
aurora.c
diff --git
a/drivers/sbus/char/aurora.c
b/drivers/sbus/char/aurora.c
index
a433252
..
a54b4ac
100644
(file)
--- a/
drivers/sbus/char/aurora.c
+++ b/
drivers/sbus/char/aurora.c
@@
-81,10
+81,6
@@
unsigned char irqs[4] = {
int irqhit=0;
#endif
int irqhit=0;
#endif
-#ifndef MIN
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#endif
-
static struct tty_driver *aurora_driver;
static struct Aurora_board aurora_board[AURORA_NBOARD] = {
{0,},
static struct tty_driver *aurora_driver;
static struct Aurora_board aurora_board[AURORA_NBOARD] = {
{0,},
@@
-96,7
+92,6
@@
static struct Aurora_port aurora_port[AURORA_TNPORTS] = {
/* no longer used. static struct Aurora_board * IRQ_to_board[16] = { NULL, } ;*/
static unsigned char * tmp_buf = NULL;
/* no longer used. static struct Aurora_board * IRQ_to_board[16] = { NULL, } ;*/
static unsigned char * tmp_buf = NULL;
-static DECLARE_MUTEX(tmp_buf_sem);
DECLARE_TASK_QUEUE(tq_aurora);
DECLARE_TASK_QUEUE(tq_aurora);
@@
-128,25
+123,25
@@
static inline int aurora_paranoia_check(struct Aurora_port const * port,
*/
/* Get board number from pointer */
*/
/* Get board number from pointer */
-
extern
inline int board_No (struct Aurora_board const * bp)
+
static
inline int board_No (struct Aurora_board const * bp)
{
return bp - aurora_board;
}
/* Get port number from pointer */
{
return bp - aurora_board;
}
/* Get port number from pointer */
-
extern
inline int port_No (struct Aurora_port const * port)
+
static
inline int port_No (struct Aurora_port const * port)
{
return AURORA_PORT(port - aurora_port);
}
/* Get pointer to board from pointer to port */
{
return AURORA_PORT(port - aurora_port);
}
/* Get pointer to board from pointer to port */
-
extern
inline struct Aurora_board * port_Board(struct Aurora_port const * port)
+
static
inline struct Aurora_board * port_Board(struct Aurora_port const * port)
{
return &aurora_board[AURORA_BOARD(port - aurora_port)];
}
/* Wait for Channel Command Register ready */
{
return &aurora_board[AURORA_BOARD(port - aurora_port)];
}
/* Wait for Channel Command Register ready */
-
extern
inline void aurora_wait_CCR(struct aurora_reg128 * r)
+
static
inline void aurora_wait_CCR(struct aurora_reg128 * r)
{
unsigned long delay;
{
unsigned long delay;
@@
-165,7
+160,7
@@
printk("aurora_wait_CCR\n");
*/
/* Must be called with enabled interrupts */
*/
/* Must be called with enabled interrupts */
-
extern
inline void aurora_long_delay(unsigned long delay)
+
static
inline void aurora_long_delay(unsigned long delay)
{
unsigned long i;
{
unsigned long i;
@@
-259,7
+254,7
@@
for(i=0;i<TYPE_1_IRQS;i++)
return 0;
}
return 0;
}
-static irqreturn_t aurora_interrupt(int irq, void * dev_id
, struct pt_regs * regs
);
+static irqreturn_t aurora_interrupt(int irq, void * dev_id);
/* Main probing routine, also sets irq. */
static int aurora_probe(void)
/* Main probing routine, also sets irq. */
static int aurora_probe(void)
@@
-342,19
+337,19
@@
static int aurora_probe(void)
printk("intr pri %d\n", grrr);
#endif
if ((bp->irq=irqs[bn]) && valid_irq(bp->irq) &&
printk("intr pri %d\n", grrr);
#endif
if ((bp->irq=irqs[bn]) && valid_irq(bp->irq) &&
- !request_irq(bp->irq|0x30, aurora_interrupt,
SA_SHIRQ
, "sio16", bp)) {
+ !request_irq(bp->irq|0x30, aurora_interrupt,
IRQF_SHARED
, "sio16", bp)) {
free_irq(bp->irq|0x30, bp);
} else
if ((bp->irq=prom_getint(sdev->prom_node, "bintr")) && valid_irq(bp->irq) &&
free_irq(bp->irq|0x30, bp);
} else
if ((bp->irq=prom_getint(sdev->prom_node, "bintr")) && valid_irq(bp->irq) &&
- !request_irq(bp->irq|0x30, aurora_interrupt,
SA_SHIRQ
, "sio16", bp)) {
+ !request_irq(bp->irq|0x30, aurora_interrupt,
IRQF_SHARED
, "sio16", bp)) {
free_irq(bp->irq|0x30, bp);
} else
if ((bp->irq=prom_getint(sdev->prom_node, "intr")) && valid_irq(bp->irq) &&
free_irq(bp->irq|0x30, bp);
} else
if ((bp->irq=prom_getint(sdev->prom_node, "intr")) && valid_irq(bp->irq) &&
- !request_irq(bp->irq|0x30, aurora_interrupt,
SA_SHIRQ
, "sio16", bp)) {
+ !request_irq(bp->irq|0x30, aurora_interrupt,
IRQF_SHARED
, "sio16", bp)) {
free_irq(bp->irq|0x30, bp);
} else
for(grrr=0;grrr<TYPE_1_IRQS;grrr++) {
free_irq(bp->irq|0x30, bp);
} else
for(grrr=0;grrr<TYPE_1_IRQS;grrr++) {
- if ((bp->irq=type_1_irq[grrr])&&!request_irq(bp->irq|0x30, aurora_interrupt,
SA_SHIRQ
, "sio16", bp)) {
+ if ((bp->irq=type_1_irq[grrr])&&!request_irq(bp->irq|0x30, aurora_interrupt,
IRQF_SHARED
, "sio16", bp)) {
free_irq(bp->irq|0x30, bp);
break;
} else {
free_irq(bp->irq|0x30, bp);
break;
} else {
@@
-424,7
+419,7
@@
static void aurora_release_io_range(struct Aurora_board *bp)
sbus_iounmap((unsigned long)bp->r3, 4);
}
sbus_iounmap((unsigned long)bp->r3, 4);
}
-
extern
inline void aurora_mark_event(struct Aurora_port * port, int event)
+
static
inline void aurora_mark_event(struct Aurora_port * port, int event)
{
#ifdef AURORA_DEBUG
printk("aurora_mark_event: start\n");
{
#ifdef AURORA_DEBUG
printk("aurora_mark_event: start\n");
@@
-594,7
+589,7
@@
static void aurora_transmit(struct Aurora_board const * bp, int chip)
&bp->r[chip]->r[CD180_TDR]);
port->COR2 &= ~COR2_ETC;
}
&bp->r[chip]->r[CD180_TDR]);
port->COR2 &= ~COR2_ETC;
}
- count =
MIN
(port->break_length, 0xff);
+ count =
min
(port->break_length, 0xff);
sbus_writeb(CD180_C_ESC,
&bp->r[chip]->r[CD180_TDR]);
sbus_writeb(CD180_C_DELAY,
sbus_writeb(CD180_C_ESC,
&bp->r[chip]->r[CD180_TDR]);
sbus_writeb(CD180_C_DELAY,
@@
-694,7
+689,7
@@
static void aurora_check_modem(struct Aurora_board const * bp, int chip)
}
/* The main interrupt processing routine */
}
/* The main interrupt processing routine */
-static irqreturn_t aurora_interrupt(int irq, void * dev_id
, struct pt_regs * regs
)
+static irqreturn_t aurora_interrupt(int irq, void * dev_id)
{
unsigned char status;
unsigned char ack,chip/*,chip_id*/;
{
unsigned char status;
unsigned char ack,chip/*,chip_id*/;
@@
-875,8
+870,7
@@
static irqreturn_t aurora_interrupt(int irq, void * dev_id, struct pt_regs * reg
#ifdef AURORA_INT_DEBUG
static void aurora_timer (unsigned long ignored);
#ifdef AURORA_INT_DEBUG
static void aurora_timer (unsigned long ignored);
-static struct timer_list aurora_poll_timer =
- TIMER_INITIALIZER(aurora_timer, 0, 0);
+static DEFINE_TIMER(aurora_poll_timer, aurora_timer, 0, 0);
static void
aurora_timer (unsigned long ignored)
static void
aurora_timer (unsigned long ignored)
@@
-915,14
+909,14
@@
static int aurora_setup_board(struct Aurora_board * bp)
#ifdef AURORA_ALLIRQ
int i;
for (i = 0; i < AURORA_ALLIRQ; i++) {
#ifdef AURORA_ALLIRQ
int i;
for (i = 0; i < AURORA_ALLIRQ; i++) {
- error = request_irq(allirq[i]|0x30, aurora_interrupt,
SA_SHIRQ
,
+ error = request_irq(allirq[i]|0x30, aurora_interrupt,
IRQF_SHARED
,
"sio16", bp);
if (error)
printk(KERN_ERR "IRQ%d request error %d\n",
allirq[i], error);
}
#else
"sio16", bp);
if (error)
printk(KERN_ERR "IRQ%d request error %d\n",
allirq[i], error);
}
#else
- error = request_irq(bp->irq|0x30, aurora_interrupt,
SA_SHIRQ
,
+ error = request_irq(bp->irq|0x30, aurora_interrupt,
IRQF_SHARED
,
"sio16", bp);
if (error) {
printk(KERN_ERR "IRQ request error %d\n", error);
"sio16", bp);
if (error) {
printk(KERN_ERR "IRQ request error %d\n", error);
@@
-1519,8
+1513,7
@@
static void aurora_close(struct tty_struct * tty, struct file * filp)
*/
timeout = jiffies+HZ;
while(port->SRER & SRER_TXEMPTY) {
*/
timeout = jiffies+HZ;
while(port->SRER & SRER_TXEMPTY) {
- current->state = TASK_INTERRUPTIBLE;
- schedule_timeout(port->timeout);
+ msleep_interruptible(jiffies_to_msecs(port->timeout));
if (time_after(jiffies, timeout))
break;
}
if (time_after(jiffies, timeout))
break;
}
@@
-1537,8
+1530,7
@@
static void aurora_close(struct tty_struct * tty, struct file * filp)
port->tty = 0;
if (port->blocked_open) {
if (port->close_delay) {
port->tty = 0;
if (port->blocked_open) {
if (port->close_delay) {
- current->state = TASK_INTERRUPTIBLE;
- schedule_timeout(port->close_delay);
+ msleep_interruptible(jiffies_to_msecs(port->close_delay));
}
wake_up_interruptible(&port->open_wait);
}
}
wake_up_interruptible(&port->open_wait);
}
@@
-1575,7
+1567,7
@@
static int aurora_write(struct tty_struct * tty,
save_flags(flags);
while (1) {
cli();
save_flags(flags);
while (1) {
cli();
- c =
MIN(count, MIN
(SERIAL_XMIT_SIZE - port->xmit_cnt - 1,
+ c =
min(count, min
(SERIAL_XMIT_SIZE - port->xmit_cnt - 1,
SERIAL_XMIT_SIZE - port->xmit_head));
if (c <= 0) {
restore_flags(flags);
SERIAL_XMIT_SIZE - port->xmit_head));
if (c <= 0) {
restore_flags(flags);
@@
-1887,14
+1879,12
@@
extern int aurora_get_serial_info(struct Aurora_port * port,
{
struct serial_struct tmp;
struct Aurora_board *bp = port_Board(port);
{
struct serial_struct tmp;
struct Aurora_board *bp = port_Board(port);
- int error;
#ifdef AURORA_DEBUG
printk("aurora_get_serial_info: start\n");
#endif
#ifdef AURORA_DEBUG
printk("aurora_get_serial_info: start\n");
#endif
- error = verify_area(VERIFY_WRITE, (void *) retinfo, sizeof(tmp));
- if (error)
- return error;
+ if (!access_ok(VERIFY_WRITE, (void *) retinfo, sizeof(tmp)))
+ return -EFAULT;
memset(&tmp, 0, sizeof(tmp));
tmp.type = PORT_CIRRUS;
memset(&tmp, 0, sizeof(tmp));
tmp.type = PORT_CIRRUS;
@@
-2197,7
+2187,7
@@
static void do_softint(void *private_)
#endif
}
#endif
}
-static struct tty_operations aurora_ops = {
+static
const
struct tty_operations aurora_ops = {
.open = aurora_open,
.close = aurora_close,
.write = aurora_write,
.open = aurora_open,
.close = aurora_close,
.write = aurora_write,