mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-04-01 12:04:08 +00:00
isicom: bring into coding style
[akpm@linux-foundation.org: fix arm, cleanups] Signed-off-by: Alan Cox <alan@redhat.com> Cc: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
23d22cea85
commit
251b8dd7ee
1 changed files with 56 additions and 53 deletions
|
@ -126,8 +126,8 @@
|
|||
#include <linux/delay.h>
|
||||
#include <linux/ioport.h>
|
||||
|
||||
#include <asm/uaccess.h>
|
||||
#include <asm/io.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/io.h>
|
||||
#include <asm/system.h>
|
||||
|
||||
#include <linux/pci.h>
|
||||
|
@ -471,7 +471,8 @@ static void isicom_tx(unsigned long _data)
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (cnt <= 0) break;
|
||||
if (cnt <= 0)
|
||||
break;
|
||||
word_count = cnt >> 1;
|
||||
outsw(base, port->xmit_buf+port->xmit_tail, word_count);
|
||||
port->xmit_tail = (port->xmit_tail
|
||||
|
@ -656,7 +657,8 @@ static irqreturn_t isicom_interrupt(int irq, void *dev_id)
|
|||
if (byte_count > 0) {
|
||||
pr_dbg("Intr(0x%lx:%d): Flip buffer overflow! dropping "
|
||||
"bytes...\n", base, channel + 1);
|
||||
while(byte_count > 0) { /* drain out unread xtra data */
|
||||
/* drain out unread xtra data */
|
||||
while (byte_count > 0) {
|
||||
inw(base);
|
||||
byte_count -= 2;
|
||||
}
|
||||
|
@ -679,8 +681,11 @@ static void isicom_config_port(struct isi_port *port)
|
|||
shift_count = card->shift_count;
|
||||
unsigned char flow_ctrl;
|
||||
|
||||
if (!(tty = port->tty) || !tty->termios)
|
||||
tty = port->tty;
|
||||
|
||||
if (tty == NULL)
|
||||
return;
|
||||
/* FIXME: Switch to new tty baud API */
|
||||
baud = C_BAUD(tty);
|
||||
if (baud & CBAUDEX) {
|
||||
baud &= ~CBAUDEX;
|
||||
|
@ -716,8 +721,7 @@ static void isicom_config_port(struct isi_port *port)
|
|||
/* hang up */
|
||||
drop_dtr(port);
|
||||
return;
|
||||
}
|
||||
else
|
||||
} else
|
||||
raise_dtr(port);
|
||||
|
||||
if (WaitTillCardIsFree(base) == 0) {
|
||||
|
@ -805,20 +809,19 @@ static int isicom_setup_port(struct isi_port *port)
|
|||
struct isi_board *card = port->card;
|
||||
unsigned long flags;
|
||||
|
||||
if (port->flags & ASYNC_INITIALIZED) {
|
||||
if (port->flags & ASYNC_INITIALIZED)
|
||||
return 0;
|
||||
}
|
||||
if (!port->xmit_buf) {
|
||||
unsigned long page;
|
||||
/* Relies on BKL */
|
||||
void *xmit_buf = (void *)get_zeroed_page(GFP_KERNEL);
|
||||
|
||||
if (!(page = get_zeroed_page(GFP_KERNEL)))
|
||||
if (xmit_buf == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
if (port->xmit_buf) {
|
||||
free_page(page);
|
||||
free_page((unsigned long)xmit_buf);
|
||||
return -ERESTARTSYS;
|
||||
}
|
||||
port->xmit_buf = (unsigned char *) page;
|
||||
port->xmit_buf = xmit_buf;
|
||||
}
|
||||
|
||||
spin_lock_irqsave(&card->card_lock, flags);
|
||||
|
@ -949,22 +952,19 @@ static int isicom_open(struct tty_struct *tty, struct file *filp)
|
|||
port->count++;
|
||||
tty->driver_data = port;
|
||||
port->tty = tty;
|
||||
if ((error = isicom_setup_port(port))!=0)
|
||||
error = isicom_setup_port(port);
|
||||
if (error == 0)
|
||||
error = block_til_ready(tty, filp, port);
|
||||
return error;
|
||||
if ((error = block_til_ready(tty, filp, port))!=0)
|
||||
return error;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* close et all */
|
||||
|
||||
static inline void isicom_shutdown_board(struct isi_board *bp)
|
||||
{
|
||||
if (bp->status & BOARD_ACTIVE) {
|
||||
if (bp->status & BOARD_ACTIVE)
|
||||
bp->status &= ~BOARD_ACTIVE;
|
||||
}
|
||||
}
|
||||
|
||||
/* card->lock HAS to be held */
|
||||
static void isicom_shutdown_port(struct isi_port *port)
|
||||
|
@ -1153,15 +1153,15 @@ static void isicom_put_char(struct tty_struct *tty, unsigned char ch)
|
|||
return;
|
||||
|
||||
spin_lock_irqsave(&card->card_lock, flags);
|
||||
if (port->xmit_cnt >= SERIAL_XMIT_SIZE - 1) {
|
||||
spin_unlock_irqrestore(&card->card_lock, flags);
|
||||
return;
|
||||
}
|
||||
if (port->xmit_cnt >= SERIAL_XMIT_SIZE - 1)
|
||||
goto out;
|
||||
|
||||
port->xmit_buf[port->xmit_head++] = ch;
|
||||
port->xmit_head &= (SERIAL_XMIT_SIZE - 1);
|
||||
port->xmit_cnt++;
|
||||
spin_unlock_irqrestore(&card->card_lock, flags);
|
||||
out:
|
||||
return;
|
||||
}
|
||||
|
||||
/* flush_chars et all */
|
||||
|
@ -1288,8 +1288,7 @@ static int isicom_set_serial_info(struct isi_port *port,
|
|||
}
|
||||
port->flags = ((port->flags & ~ASYNC_USR_MASK) |
|
||||
(newinfo.flags & ASYNC_USR_MASK));
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
port->close_delay = newinfo.close_delay;
|
||||
port->closing_wait = newinfo.closing_wait;
|
||||
port->flags = ((port->flags & ~ASYNC_FLAGS) |
|
||||
|
@ -1613,7 +1612,8 @@ static int __devinit load_firmware(struct pci_dev *pdev,
|
|||
if (WaitTillCardIsFree(base))
|
||||
goto errrelfw;
|
||||
|
||||
if ((status = inw(base + 0x4)) != 0) {
|
||||
status = inw(base + 0x4);
|
||||
if (status != 0) {
|
||||
dev_warn(&pdev->dev, "Card%d rejected load header:\n"
|
||||
KERN_WARNING "Address:0x%x\n"
|
||||
KERN_WARNING "Count:0x%x\n"
|
||||
|
@ -1630,7 +1630,8 @@ static int __devinit load_firmware(struct pci_dev *pdev,
|
|||
if (WaitTillCardIsFree(base))
|
||||
goto errrelfw;
|
||||
|
||||
if ((status = inw(base + 0x4)) != 0) {
|
||||
status = inw(base + 0x4);
|
||||
if (status != 0) {
|
||||
dev_err(&pdev->dev, "Card%d got out of sync.Card "
|
||||
"Status:0x%x\n", index + 1, status);
|
||||
goto errrelfw;
|
||||
|
@ -1659,7 +1660,8 @@ static int __devinit load_firmware(struct pci_dev *pdev,
|
|||
if (WaitTillCardIsFree(base))
|
||||
goto errrelfw;
|
||||
|
||||
if ((status = inw(base + 0x4)) != 0) {
|
||||
status = inw(base + 0x4);
|
||||
if (status != 0) {
|
||||
dev_warn(&pdev->dev, "Card%d rejected verify header:\n"
|
||||
KERN_WARNING "Address:0x%x\n"
|
||||
KERN_WARNING "Count:0x%x\n"
|
||||
|
@ -1692,7 +1694,8 @@ static int __devinit load_firmware(struct pci_dev *pdev,
|
|||
if (WaitTillCardIsFree(base))
|
||||
goto errrelfw;
|
||||
|
||||
if ((status = inw(base + 0x4)) != 0) {
|
||||
status = inw(base + 0x4);
|
||||
if (status != 0) {
|
||||
dev_err(&pdev->dev, "Card%d verify got out of sync. "
|
||||
"Card Status:0x%x\n", index + 1, status);
|
||||
goto errrelfw;
|
||||
|
|
Loading…
Add table
Reference in a new issue