Commit 8f90ef80 authored by Lidza Louina's avatar Lidza Louina Committed by Greg Kroah-Hartman

staging: dgnc: removes parentheses around return statements

This patch removes parentheses around return
statements. They aren't needed.
Signed-off-by: default avatarLidza Louina <lidza.louina@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 03425f55
...@@ -976,17 +976,17 @@ static int cls_drain(struct tty_struct *tty, uint seconds) ...@@ -976,17 +976,17 @@ static int cls_drain(struct tty_struct *tty, uint seconds)
int rc = 0; int rc = 0;
if (!tty || tty->magic != TTY_MAGIC) { if (!tty || tty->magic != TTY_MAGIC) {
return (-ENXIO); return -ENXIO;
} }
un = (struct un_t *) tty->driver_data; un = (struct un_t *) tty->driver_data;
if (!un || un->magic != DGNC_UNIT_MAGIC) { if (!un || un->magic != DGNC_UNIT_MAGIC) {
return (-ENXIO); return -ENXIO;
} }
ch = un->un_ch; ch = un->un_ch;
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) { if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) {
return (-ENXIO); return -ENXIO;
} }
DGNC_LOCK(ch->ch_lock, lock_flags); DGNC_LOCK(ch->ch_lock, lock_flags);
...@@ -1002,7 +1002,7 @@ static int cls_drain(struct tty_struct *tty, uint seconds) ...@@ -1002,7 +1002,7 @@ static int cls_drain(struct tty_struct *tty, uint seconds)
if (rc) if (rc)
DPR_IOCTL(("%d Drain - User ctrl c'ed\n", __LINE__)); DPR_IOCTL(("%d Drain - User ctrl c'ed\n", __LINE__));
return (rc); return rc;
} }
......
...@@ -225,7 +225,7 @@ int dgnc_init_module(void) ...@@ -225,7 +225,7 @@ int dgnc_init_module(void)
rc = dgnc_start(); rc = dgnc_start();
if (rc < 0) { if (rc < 0) {
return(rc); return rc;
} }
/* /*
...@@ -250,7 +250,7 @@ int dgnc_init_module(void) ...@@ -250,7 +250,7 @@ int dgnc_init_module(void)
} }
DPR_INIT(("Finished init_module. Returning %d\n", rc)); DPR_INIT(("Finished init_module. Returning %d\n", rc));
return (rc); return rc;
} }
...@@ -286,7 +286,7 @@ static int dgnc_start(void) ...@@ -286,7 +286,7 @@ static int dgnc_start(void)
if (rc <= 0) { if (rc <= 0) {
APR(("Can't register dgnc driver device (%d)\n", rc)); APR(("Can't register dgnc driver device (%d)\n", rc));
rc = -ENXIO; rc = -ENXIO;
return(rc); return rc;
} }
dgnc_Major = rc; dgnc_Major = rc;
...@@ -311,7 +311,7 @@ static int dgnc_start(void) ...@@ -311,7 +311,7 @@ static int dgnc_start(void)
if (rc < 0) { if (rc < 0) {
APR(("tty preinit - not enough memory (%d)\n", rc)); APR(("tty preinit - not enough memory (%d)\n", rc));
return(rc); return rc;
} }
/* Start the poller */ /* Start the poller */
...@@ -328,7 +328,7 @@ static int dgnc_start(void) ...@@ -328,7 +328,7 @@ static int dgnc_start(void)
dgnc_driver_state = DRIVER_READY; dgnc_driver_state = DRIVER_READY;
} }
return(rc); return rc;
} }
/* /*
...@@ -502,7 +502,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id) ...@@ -502,7 +502,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
(struct dgnc_board *) kzalloc(sizeof(struct dgnc_board), GFP_KERNEL); (struct dgnc_board *) kzalloc(sizeof(struct dgnc_board), GFP_KERNEL);
if (!brd) { if (!brd) {
APR(("memory allocation for board structure failed\n")); APR(("memory allocation for board structure failed\n"));
return(-ENOMEM); return -ENOMEM;
} }
/* make a temporary message buffer for the boot messages */ /* make a temporary message buffer for the boot messages */
...@@ -511,7 +511,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id) ...@@ -511,7 +511,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
if (!brd->msgbuf) { if (!brd->msgbuf) {
kfree(brd); kfree(brd);
APR(("memory allocation for board msgbuf failed\n")); APR(("memory allocation for board msgbuf failed\n"));
return(-ENOMEM); return -ENOMEM;
} }
/* store the info for the board we've found */ /* store the info for the board we've found */
...@@ -663,7 +663,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id) ...@@ -663,7 +663,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
default: default:
APR(("Did not find any compatible Neo or Classic PCI boards in system.\n")); APR(("Did not find any compatible Neo or Classic PCI boards in system.\n"));
return (-ENXIO); return -ENXIO;
} }
...@@ -725,11 +725,11 @@ static int dgnc_found_board(struct pci_dev *pdev, int id) ...@@ -725,11 +725,11 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
wake_up_interruptible(&brd->state_wait); wake_up_interruptible(&brd->state_wait);
return(0); return 0;
failed: failed:
return (-ENXIO); return -ENXIO;
} }
...@@ -740,7 +740,7 @@ static int dgnc_finalize_board_init(struct dgnc_board *brd) { ...@@ -740,7 +740,7 @@ static int dgnc_finalize_board_init(struct dgnc_board *brd) {
DPR_INIT(("dgnc_finalize_board_init() - start\n")); DPR_INIT(("dgnc_finalize_board_init() - start\n"));
if (!brd || brd->magic != DGNC_BOARD_MAGIC) if (!brd || brd->magic != DGNC_BOARD_MAGIC)
return(-ENODEV); return -ENODEV;
DPR_INIT(("dgnc_finalize_board_init() - start #2\n")); DPR_INIT(("dgnc_finalize_board_init() - start #2\n"));
...@@ -756,7 +756,7 @@ static int dgnc_finalize_board_init(struct dgnc_board *brd) { ...@@ -756,7 +756,7 @@ static int dgnc_finalize_board_init(struct dgnc_board *brd) {
DPR_INIT(("Requested and received usage of IRQ %d\n", brd->irq)); DPR_INIT(("Requested and received usage of IRQ %d\n", brd->irq));
} }
} }
return(rc); return rc;
} }
/* /*
...@@ -900,7 +900,7 @@ int dgnc_ms_sleep(ulong ms) ...@@ -900,7 +900,7 @@ int dgnc_ms_sleep(ulong ms)
{ {
current->state = TASK_INTERRUPTIBLE; current->state = TASK_INTERRUPTIBLE;
schedule_timeout((ms * HZ) / 1000); schedule_timeout((ms * HZ) / 1000);
return (signal_pending(current)); return signal_pending(current);
} }
...@@ -912,47 +912,47 @@ char *dgnc_ioctl_name(int cmd) ...@@ -912,47 +912,47 @@ char *dgnc_ioctl_name(int cmd)
{ {
switch(cmd) { switch(cmd) {
case TCGETA: return("TCGETA"); case TCGETA: return "TCGETA";
case TCGETS: return("TCGETS"); case TCGETS: return "TCGETS";
case TCSETA: return("TCSETA"); case TCSETA: return "TCSETA";
case TCSETS: return("TCSETS"); case TCSETS: return "TCSETS";
case TCSETAW: return("TCSETAW"); case TCSETAW: return "TCSETAW";
case TCSETSW: return("TCSETSW"); case TCSETSW: return "TCSETSW";
case TCSETAF: return("TCSETAF"); case TCSETAF: return "TCSETAF";
case TCSETSF: return("TCSETSF"); case TCSETSF: return "TCSETSF";
case TCSBRK: return("TCSBRK"); case TCSBRK: return "TCSBRK";
case TCXONC: return("TCXONC"); case TCXONC: return "TCXONC";
case TCFLSH: return("TCFLSH"); case TCFLSH: return "TCFLSH";
case TIOCGSID: return("TIOCGSID"); case TIOCGSID: return "TIOCGSID";
case TIOCGETD: return("TIOCGETD"); case TIOCGETD: return "TIOCGETD";
case TIOCSETD: return("TIOCSETD"); case TIOCSETD: return "TIOCSETD";
case TIOCGWINSZ: return("TIOCGWINSZ"); case TIOCGWINSZ: return "TIOCGWINSZ";
case TIOCSWINSZ: return("TIOCSWINSZ"); case TIOCSWINSZ: return "TIOCSWINSZ";
case TIOCMGET: return("TIOCMGET"); case TIOCMGET: return "TIOCMGET";
case TIOCMSET: return("TIOCMSET"); case TIOCMSET: return "TIOCMSET";
case TIOCMBIS: return("TIOCMBIS"); case TIOCMBIS: return "TIOCMBIS";
case TIOCMBIC: return("TIOCMBIC"); case TIOCMBIC: return "TIOCMBIC";
/* from digi.h */ /* from digi.h */
case DIGI_SETA: return("DIGI_SETA"); case DIGI_SETA: return "DIGI_SETA";
case DIGI_SETAW: return("DIGI_SETAW"); case DIGI_SETAW: return "DIGI_SETAW";
case DIGI_SETAF: return("DIGI_SETAF"); case DIGI_SETAF: return "DIGI_SETAF";
case DIGI_SETFLOW: return("DIGI_SETFLOW"); case DIGI_SETFLOW: return "DIGI_SETFLOW";
case DIGI_SETAFLOW: return("DIGI_SETAFLOW"); case DIGI_SETAFLOW: return "DIGI_SETAFLOW";
case DIGI_GETFLOW: return("DIGI_GETFLOW"); case DIGI_GETFLOW: return "DIGI_GETFLOW";
case DIGI_GETAFLOW: return("DIGI_GETAFLOW"); case DIGI_GETAFLOW: return "DIGI_GETAFLOW";
case DIGI_GETA: return("DIGI_GETA"); case DIGI_GETA: return "DIGI_GETA";
case DIGI_GEDELAY: return("DIGI_GEDELAY"); case DIGI_GEDELAY: return "DIGI_GEDELAY";
case DIGI_SEDELAY: return("DIGI_SEDELAY"); case DIGI_SEDELAY: return "DIGI_SEDELAY";
case DIGI_GETCUSTOMBAUD: return("DIGI_GETCUSTOMBAUD"); case DIGI_GETCUSTOMBAUD: return "DIGI_GETCUSTOMBAUD";
case DIGI_SETCUSTOMBAUD: return("DIGI_SETCUSTOMBAUD"); case DIGI_SETCUSTOMBAUD: return "DIGI_SETCUSTOMBAUD";
case TIOCMODG: return("TIOCMODG"); case TIOCMODG: return "TIOCMODG";
case TIOCMODS: return("TIOCMODS"); case TIOCMODS: return "TIOCMODS";
case TIOCSDTR: return("TIOCSDTR"); case TIOCSDTR: return "TIOCSDTR";
case TIOCCDTR: return("TIOCCDTR"); case TIOCCDTR: return "TIOCCDTR";
default: return("unknown"); default: return "unknown";
} }
} }
...@@ -74,13 +74,13 @@ int dgnc_mgmt_open(struct inode *inode, struct file *file) ...@@ -74,13 +74,13 @@ int dgnc_mgmt_open(struct inode *inode, struct file *file)
/* Only allow 1 open at a time on mgmt device */ /* Only allow 1 open at a time on mgmt device */
if (dgnc_mgmt_in_use[minor]) { if (dgnc_mgmt_in_use[minor]) {
DGNC_UNLOCK(dgnc_global_lock, lock_flags); DGNC_UNLOCK(dgnc_global_lock, lock_flags);
return (-EBUSY); return -EBUSY;
} }
dgnc_mgmt_in_use[minor]++; dgnc_mgmt_in_use[minor]++;
} }
else { else {
DGNC_UNLOCK(dgnc_global_lock, lock_flags); DGNC_UNLOCK(dgnc_global_lock, lock_flags);
return (-ENXIO); return -ENXIO;
} }
DGNC_UNLOCK(dgnc_global_lock, lock_flags); DGNC_UNLOCK(dgnc_global_lock, lock_flags);
...@@ -154,7 +154,7 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -154,7 +154,7 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
ddi.dinfo_nboards, ddi.dinfo_version)); ddi.dinfo_nboards, ddi.dinfo_version));
if (copy_to_user(uarg, &ddi, sizeof (ddi))) if (copy_to_user(uarg, &ddi, sizeof (ddi)))
return(-EFAULT); return -EFAULT;
break; break;
} }
...@@ -166,13 +166,13 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -166,13 +166,13 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
struct digi_info di; struct digi_info di;
if (copy_from_user(&brd, uarg, sizeof(int))) { if (copy_from_user(&brd, uarg, sizeof(int))) {
return(-EFAULT); return -EFAULT;
} }
DPR_MGMT(("DIGI_GETBD asking about board: %d\n", brd)); DPR_MGMT(("DIGI_GETBD asking about board: %d\n", brd));
if ((brd < 0) || (brd > dgnc_NumBoards) || (dgnc_NumBoards == 0)) if ((brd < 0) || (brd > dgnc_NumBoards) || (dgnc_NumBoards == 0))
return (-ENODEV); return -ENODEV;
memset(&di, 0, sizeof(di)); memset(&di, 0, sizeof(di));
...@@ -196,7 +196,7 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -196,7 +196,7 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
di.info_bdtype, di.info_bdstate, di.info_nports, di.info_physsize)); di.info_bdtype, di.info_bdstate, di.info_nports, di.info_physsize));
if (copy_to_user(uarg, &di, sizeof (di))) if (copy_to_user(uarg, &di, sizeof (di)))
return (-EFAULT); return -EFAULT;
break; break;
} }
...@@ -210,7 +210,7 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -210,7 +210,7 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
uint channel = 0; uint channel = 0;
if (copy_from_user(&ni, uarg, sizeof(struct ni_info))) { if (copy_from_user(&ni, uarg, sizeof(struct ni_info))) {
return(-EFAULT); return -EFAULT;
} }
DPR_MGMT(("DIGI_GETBD asking about board: %d channel: %d\n", DPR_MGMT(("DIGI_GETBD asking about board: %d channel: %d\n",
...@@ -221,16 +221,16 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -221,16 +221,16 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
/* Verify boundaries on board */ /* Verify boundaries on board */
if ((board < 0) || (board > dgnc_NumBoards) || (dgnc_NumBoards == 0)) if ((board < 0) || (board > dgnc_NumBoards) || (dgnc_NumBoards == 0))
return (-ENODEV); return -ENODEV;
/* Verify boundaries on channel */ /* Verify boundaries on channel */
if ((channel < 0) || (channel > dgnc_Board[board]->nasync)) if ((channel < 0) || (channel > dgnc_Board[board]->nasync))
return (-ENODEV); return -ENODEV;
ch = dgnc_Board[board]->channels[channel]; ch = dgnc_Board[board]->channels[channel];
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
return (-ENODEV); return -ENODEV;
memset(&ni, 0, sizeof(ni)); memset(&ni, 0, sizeof(ni));
ni.board = board; ni.board = board;
...@@ -291,7 +291,7 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -291,7 +291,7 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
DGNC_UNLOCK(ch->ch_lock, lock_flags); DGNC_UNLOCK(ch->ch_lock, lock_flags);
if (copy_to_user(uarg, &ni, sizeof(ni))) if (copy_to_user(uarg, &ni, sizeof(ni)))
return (-EFAULT); return -EFAULT;
break; break;
} }
......
...@@ -1404,17 +1404,17 @@ static int neo_drain(struct tty_struct *tty, uint seconds) ...@@ -1404,17 +1404,17 @@ static int neo_drain(struct tty_struct *tty, uint seconds)
int rc = 0; int rc = 0;
if (!tty || tty->magic != TTY_MAGIC) { if (!tty || tty->magic != TTY_MAGIC) {
return (-ENXIO); return -ENXIO;
} }
un = (struct un_t *) tty->driver_data; un = (struct un_t *) tty->driver_data;
if (!un || un->magic != DGNC_UNIT_MAGIC) { if (!un || un->magic != DGNC_UNIT_MAGIC) {
return (-ENXIO); return -ENXIO;
} }
ch = un->un_ch; ch = un->un_ch;
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) { if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) {
return (-ENXIO); return -ENXIO;
} }
DPR_IOCTL(("%d Drain wait started.\n", __LINE__)); DPR_IOCTL(("%d Drain wait started.\n", __LINE__));
...@@ -1439,7 +1439,7 @@ static int neo_drain(struct tty_struct *tty, uint seconds) ...@@ -1439,7 +1439,7 @@ static int neo_drain(struct tty_struct *tty, uint seconds)
DPR_IOCTL(("%d Drain wait finished.\n", __LINE__)); DPR_IOCTL(("%d Drain wait finished.\n", __LINE__));
} }
return (rc); return rc;
} }
......
...@@ -152,13 +152,13 @@ void dgnc_remove_driver_sysfiles(struct pci_driver *dgnc_driver) ...@@ -152,13 +152,13 @@ void dgnc_remove_driver_sysfiles(struct pci_driver *dgnc_driver)
#define DGNC_VERIFY_BOARD(p, bd) \ #define DGNC_VERIFY_BOARD(p, bd) \
if (!p) \ if (!p) \
return (0); \ return 0; \
\ \
bd = dev_get_drvdata(p); \ bd = dev_get_drvdata(p); \
if (!bd || bd->magic != DGNC_BOARD_MAGIC) \ if (!bd || bd->magic != DGNC_BOARD_MAGIC) \
return (0); \ return 0; \
if (bd->state != BOARD_READY) \ if (bd->state != BOARD_READY) \
return (0); \ return 0; \
...@@ -432,18 +432,18 @@ static ssize_t dgnc_tty_state_show(struct device *d, struct device_attribute *at ...@@ -432,18 +432,18 @@ static ssize_t dgnc_tty_state_show(struct device *d, struct device_attribute *at
struct un_t *un; struct un_t *un;
if (!d) if (!d)
return (0); return 0;
un = (struct un_t *) dev_get_drvdata(d); un = (struct un_t *) dev_get_drvdata(d);
if (!un || un->magic != DGNC_UNIT_MAGIC) if (!un || un->magic != DGNC_UNIT_MAGIC)
return (0); return 0;
ch = un->un_ch; ch = un->un_ch;
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
return (0); return 0;
bd = ch->ch_bd; bd = ch->ch_bd;
if (!bd || bd->magic != DGNC_BOARD_MAGIC) if (!bd || bd->magic != DGNC_BOARD_MAGIC)
return (0); return 0;
if (bd->state != BOARD_READY) if (bd->state != BOARD_READY)
return (0); return 0;
return snprintf(buf, PAGE_SIZE, "%s", un->un_open_count ? "Open" : "Closed"); return snprintf(buf, PAGE_SIZE, "%s", un->un_open_count ? "Open" : "Closed");
} }
...@@ -457,18 +457,18 @@ static ssize_t dgnc_tty_baud_show(struct device *d, struct device_attribute *att ...@@ -457,18 +457,18 @@ static ssize_t dgnc_tty_baud_show(struct device *d, struct device_attribute *att
struct un_t *un; struct un_t *un;
if (!d) if (!d)
return (0); return 0;
un = (struct un_t *) dev_get_drvdata(d); un = (struct un_t *) dev_get_drvdata(d);
if (!un || un->magic != DGNC_UNIT_MAGIC) if (!un || un->magic != DGNC_UNIT_MAGIC)
return (0); return 0;
ch = un->un_ch; ch = un->un_ch;
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
return (0); return 0;
bd = ch->ch_bd; bd = ch->ch_bd;
if (!bd || bd->magic != DGNC_BOARD_MAGIC) if (!bd || bd->magic != DGNC_BOARD_MAGIC)
return (0); return 0;
if (bd->state != BOARD_READY) if (bd->state != BOARD_READY)
return (0); return 0;
return snprintf(buf, PAGE_SIZE, "%d\n", ch->ch_old_baud); return snprintf(buf, PAGE_SIZE, "%d\n", ch->ch_old_baud);
} }
...@@ -482,18 +482,18 @@ static ssize_t dgnc_tty_msignals_show(struct device *d, struct device_attribute ...@@ -482,18 +482,18 @@ static ssize_t dgnc_tty_msignals_show(struct device *d, struct device_attribute
struct un_t *un; struct un_t *un;
if (!d) if (!d)
return (0); return 0;
un = (struct un_t *) dev_get_drvdata(d); un = (struct un_t *) dev_get_drvdata(d);
if (!un || un->magic != DGNC_UNIT_MAGIC) if (!un || un->magic != DGNC_UNIT_MAGIC)
return (0); return 0;
ch = un->un_ch; ch = un->un_ch;
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
return (0); return 0;
bd = ch->ch_bd; bd = ch->ch_bd;
if (!bd || bd->magic != DGNC_BOARD_MAGIC) if (!bd || bd->magic != DGNC_BOARD_MAGIC)
return (0); return 0;
if (bd->state != BOARD_READY) if (bd->state != BOARD_READY)
return (0); return 0;
if (ch->ch_open_count) { if (ch->ch_open_count) {
return snprintf(buf, PAGE_SIZE, "%s %s %s %s %s %s\n", return snprintf(buf, PAGE_SIZE, "%s %s %s %s %s %s\n",
...@@ -516,18 +516,18 @@ static ssize_t dgnc_tty_iflag_show(struct device *d, struct device_attribute *at ...@@ -516,18 +516,18 @@ static ssize_t dgnc_tty_iflag_show(struct device *d, struct device_attribute *at
struct un_t *un; struct un_t *un;
if (!d) if (!d)
return (0); return 0;
un = (struct un_t *) dev_get_drvdata(d); un = (struct un_t *) dev_get_drvdata(d);
if (!un || un->magic != DGNC_UNIT_MAGIC) if (!un || un->magic != DGNC_UNIT_MAGIC)
return (0); return 0;
ch = un->un_ch; ch = un->un_ch;
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
return (0); return 0;
bd = ch->ch_bd; bd = ch->ch_bd;
if (!bd || bd->magic != DGNC_BOARD_MAGIC) if (!bd || bd->magic != DGNC_BOARD_MAGIC)
return (0); return 0;
if (bd->state != BOARD_READY) if (bd->state != BOARD_READY)
return (0); return 0;
return snprintf(buf, PAGE_SIZE, "%x\n", ch->ch_c_iflag); return snprintf(buf, PAGE_SIZE, "%x\n", ch->ch_c_iflag);
} }
...@@ -541,18 +541,18 @@ static ssize_t dgnc_tty_cflag_show(struct device *d, struct device_attribute *at ...@@ -541,18 +541,18 @@ static ssize_t dgnc_tty_cflag_show(struct device *d, struct device_attribute *at
struct un_t *un; struct un_t *un;
if (!d) if (!d)
return (0); return 0;
un = (struct un_t *) dev_get_drvdata(d); un = (struct un_t *) dev_get_drvdata(d);
if (!un || un->magic != DGNC_UNIT_MAGIC) if (!un || un->magic != DGNC_UNIT_MAGIC)
return (0); return 0;
ch = un->un_ch; ch = un->un_ch;
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
return (0); return 0;
bd = ch->ch_bd; bd = ch->ch_bd;
if (!bd || bd->magic != DGNC_BOARD_MAGIC) if (!bd || bd->magic != DGNC_BOARD_MAGIC)
return (0); return 0;
if (bd->state != BOARD_READY) if (bd->state != BOARD_READY)
return (0); return 0;
return snprintf(buf, PAGE_SIZE, "%x\n", ch->ch_c_cflag); return snprintf(buf, PAGE_SIZE, "%x\n", ch->ch_c_cflag);
} }
...@@ -566,18 +566,18 @@ static ssize_t dgnc_tty_oflag_show(struct device *d, struct device_attribute *at ...@@ -566,18 +566,18 @@ static ssize_t dgnc_tty_oflag_show(struct device *d, struct device_attribute *at
struct un_t *un; struct un_t *un;
if (!d) if (!d)
return (0); return 0;
un = (struct un_t *) dev_get_drvdata(d); un = (struct un_t *) dev_get_drvdata(d);
if (!un || un->magic != DGNC_UNIT_MAGIC) if (!un || un->magic != DGNC_UNIT_MAGIC)
return (0); return 0;
ch = un->un_ch; ch = un->un_ch;
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
return (0); return 0;
bd = ch->ch_bd; bd = ch->ch_bd;
if (!bd || bd->magic != DGNC_BOARD_MAGIC) if (!bd || bd->magic != DGNC_BOARD_MAGIC)
return (0); return 0;
if (bd->state != BOARD_READY) if (bd->state != BOARD_READY)
return (0); return 0;
return snprintf(buf, PAGE_SIZE, "%x\n", ch->ch_c_oflag); return snprintf(buf, PAGE_SIZE, "%x\n", ch->ch_c_oflag);
} }
...@@ -591,18 +591,18 @@ static ssize_t dgnc_tty_lflag_show(struct device *d, struct device_attribute *at ...@@ -591,18 +591,18 @@ static ssize_t dgnc_tty_lflag_show(struct device *d, struct device_attribute *at
struct un_t *un; struct un_t *un;
if (!d) if (!d)
return (0); return 0;
un = (struct un_t *) dev_get_drvdata(d); un = (struct un_t *) dev_get_drvdata(d);
if (!un || un->magic != DGNC_UNIT_MAGIC) if (!un || un->magic != DGNC_UNIT_MAGIC)
return (0); return 0;
ch = un->un_ch; ch = un->un_ch;
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
return (0); return 0;
bd = ch->ch_bd; bd = ch->ch_bd;
if (!bd || bd->magic != DGNC_BOARD_MAGIC) if (!bd || bd->magic != DGNC_BOARD_MAGIC)
return (0); return 0;
if (bd->state != BOARD_READY) if (bd->state != BOARD_READY)
return (0); return 0;
return snprintf(buf, PAGE_SIZE, "%x\n", ch->ch_c_lflag); return snprintf(buf, PAGE_SIZE, "%x\n", ch->ch_c_lflag);
} }
...@@ -616,18 +616,18 @@ static ssize_t dgnc_tty_digi_flag_show(struct device *d, struct device_attribute ...@@ -616,18 +616,18 @@ static ssize_t dgnc_tty_digi_flag_show(struct device *d, struct device_attribute
struct un_t *un; struct un_t *un;
if (!d) if (!d)
return (0); return 0;
un = (struct un_t *) dev_get_drvdata(d); un = (struct un_t *) dev_get_drvdata(d);
if (!un || un->magic != DGNC_UNIT_MAGIC) if (!un || un->magic != DGNC_UNIT_MAGIC)
return (0); return 0;
ch = un->un_ch; ch = un->un_ch;
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
return (0); return 0;
bd = ch->ch_bd; bd = ch->ch_bd;
if (!bd || bd->magic != DGNC_BOARD_MAGIC) if (!bd || bd->magic != DGNC_BOARD_MAGIC)
return (0); return 0;
if (bd->state != BOARD_READY) if (bd->state != BOARD_READY)
return (0); return 0;
return snprintf(buf, PAGE_SIZE, "%x\n", ch->ch_digi.digi_flags); return snprintf(buf, PAGE_SIZE, "%x\n", ch->ch_digi.digi_flags);
} }
...@@ -641,18 +641,18 @@ static ssize_t dgnc_tty_rxcount_show(struct device *d, struct device_attribute * ...@@ -641,18 +641,18 @@ static ssize_t dgnc_tty_rxcount_show(struct device *d, struct device_attribute *
struct un_t *un; struct un_t *un;
if (!d) if (!d)
return (0); return 0;
un = (struct un_t *) dev_get_drvdata(d); un = (struct un_t *) dev_get_drvdata(d);
if (!un || un->magic != DGNC_UNIT_MAGIC) if (!un || un->magic != DGNC_UNIT_MAGIC)
return (0); return 0;
ch = un->un_ch; ch = un->un_ch;
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
return (0); return 0;
bd = ch->ch_bd; bd = ch->ch_bd;
if (!bd || bd->magic != DGNC_BOARD_MAGIC) if (!bd || bd->magic != DGNC_BOARD_MAGIC)
return (0); return 0;
if (bd->state != BOARD_READY) if (bd->state != BOARD_READY)
return (0); return 0;
return snprintf(buf, PAGE_SIZE, "%ld\n", ch->ch_rxcount); return snprintf(buf, PAGE_SIZE, "%ld\n", ch->ch_rxcount);
} }
...@@ -666,18 +666,18 @@ static ssize_t dgnc_tty_txcount_show(struct device *d, struct device_attribute * ...@@ -666,18 +666,18 @@ static ssize_t dgnc_tty_txcount_show(struct device *d, struct device_attribute *
struct un_t *un; struct un_t *un;
if (!d) if (!d)
return (0); return 0;
un = (struct un_t *) dev_get_drvdata(d); un = (struct un_t *) dev_get_drvdata(d);
if (!un || un->magic != DGNC_UNIT_MAGIC) if (!un || un->magic != DGNC_UNIT_MAGIC)
return (0); return 0;
ch = un->un_ch; ch = un->un_ch;
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
return (0); return 0;
bd = ch->ch_bd; bd = ch->ch_bd;
if (!bd || bd->magic != DGNC_BOARD_MAGIC) if (!bd || bd->magic != DGNC_BOARD_MAGIC)
return (0); return 0;
if (bd->state != BOARD_READY) if (bd->state != BOARD_READY)
return (0); return 0;
return snprintf(buf, PAGE_SIZE, "%ld\n", ch->ch_txcount); return snprintf(buf, PAGE_SIZE, "%ld\n", ch->ch_txcount);
} }
...@@ -691,18 +691,18 @@ static ssize_t dgnc_tty_name_show(struct device *d, struct device_attribute *att ...@@ -691,18 +691,18 @@ static ssize_t dgnc_tty_name_show(struct device *d, struct device_attribute *att
struct un_t *un; struct un_t *un;
if (!d) if (!d)
return (0); return 0;
un = (struct un_t *) dev_get_drvdata(d); un = (struct un_t *) dev_get_drvdata(d);
if (!un || un->magic != DGNC_UNIT_MAGIC) if (!un || un->magic != DGNC_UNIT_MAGIC)
return (0); return 0;
ch = un->un_ch; ch = un->un_ch;
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
return (0); return 0;
bd = ch->ch_bd; bd = ch->ch_bd;
if (!bd || bd->magic != DGNC_BOARD_MAGIC) if (!bd || bd->magic != DGNC_BOARD_MAGIC)
return (0); return 0;
if (bd->state != BOARD_READY) if (bd->state != BOARD_READY)
return (0); return 0;
return snprintf(buf, PAGE_SIZE, "%sn%d%c\n", return snprintf(buf, PAGE_SIZE, "%sn%d%c\n",
(un->un_type == DGNC_PRINT) ? "pr" : "tty", (un->un_type == DGNC_PRINT) ? "pr" : "tty",
......
This diff is collapsed.
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