diff options
Diffstat (limited to 'drivers/net/wan/pc300_tty.c')
-rw-r--r-- | drivers/net/wan/pc300_tty.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/wan/pc300_tty.c b/drivers/net/wan/pc300_tty.c index e24a7b095dd6..63abfd72542d 100644 --- a/drivers/net/wan/pc300_tty.c +++ b/drivers/net/wan/pc300_tty.c | |||
@@ -313,7 +313,7 @@ static int cpc_tty_open(struct tty_struct *tty, struct file *flip) | |||
313 | if (cpc_tty->num_open == 0) { /* first open of this tty */ | 313 | if (cpc_tty->num_open == 0) { /* first open of this tty */ |
314 | if (!cpc_tty_area[port].buf_tx){ | 314 | if (!cpc_tty_area[port].buf_tx){ |
315 | cpc_tty_area[port].buf_tx = kmalloc(CPC_TTY_MAX_MTU,GFP_KERNEL); | 315 | cpc_tty_area[port].buf_tx = kmalloc(CPC_TTY_MAX_MTU,GFP_KERNEL); |
316 | if (cpc_tty_area[port].buf_tx == 0){ | 316 | if (!cpc_tty_area[port].buf_tx) { |
317 | CPC_TTY_DBG("%s: error in memory allocation\n",cpc_tty->name); | 317 | CPC_TTY_DBG("%s: error in memory allocation\n",cpc_tty->name); |
318 | return -ENOMEM; | 318 | return -ENOMEM; |
319 | } | 319 | } |
@@ -678,7 +678,7 @@ static void cpc_tty_rx_work(struct work_struct *work) | |||
678 | for (j=0; j < CPC_TTY_NPORTS; j++) { | 678 | for (j=0; j < CPC_TTY_NPORTS; j++) { |
679 | cpc_tty = &cpc_tty_area[port]; | 679 | cpc_tty = &cpc_tty_area[port]; |
680 | 680 | ||
681 | if ((buf=cpc_tty->buf_rx.first) != 0) { | 681 | if ((buf=cpc_tty->buf_rx.first) != NULL) { |
682 | if (cpc_tty->tty) { | 682 | if (cpc_tty->tty) { |
683 | ld = tty_ldisc_ref(cpc_tty->tty); | 683 | ld = tty_ldisc_ref(cpc_tty->tty); |
684 | if (ld) { | 684 | if (ld) { |
@@ -784,7 +784,7 @@ void cpc_tty_receive(pc300dev_t *pc300dev) | |||
784 | } | 784 | } |
785 | 785 | ||
786 | new = kmalloc(rx_len + sizeof(st_cpc_rx_buf), GFP_ATOMIC); | 786 | new = kmalloc(rx_len + sizeof(st_cpc_rx_buf), GFP_ATOMIC); |
787 | if (new == 0) { | 787 | if (!new) { |
788 | cpc_tty_rx_disc_frame(pc300chan); | 788 | cpc_tty_rx_disc_frame(pc300chan); |
789 | continue; | 789 | continue; |
790 | } | 790 | } |
@@ -863,7 +863,7 @@ void cpc_tty_receive(pc300dev_t *pc300dev) | |||
863 | } | 863 | } |
864 | new->size = rx_len; | 864 | new->size = rx_len; |
865 | new->next = NULL; | 865 | new->next = NULL; |
866 | if (cpc_tty->buf_rx.first == 0) { | 866 | if (cpc_tty->buf_rx.first == NULL) { |
867 | cpc_tty->buf_rx.first = new; | 867 | cpc_tty->buf_rx.first = new; |
868 | cpc_tty->buf_rx.last = new; | 868 | cpc_tty->buf_rx.last = new; |
869 | } else { | 869 | } else { |
@@ -891,7 +891,7 @@ static void cpc_tty_tx_work(struct work_struct *work) | |||
891 | 891 | ||
892 | CPC_TTY_DBG("%s: cpc_tty_tx_work init\n",cpc_tty->name); | 892 | CPC_TTY_DBG("%s: cpc_tty_tx_work init\n",cpc_tty->name); |
893 | 893 | ||
894 | if ((tty = cpc_tty->tty) == 0) { | 894 | if ((tty = cpc_tty->tty) == NULL) { |
895 | CPC_TTY_DBG("%s: the interface is not opened\n",cpc_tty->name); | 895 | CPC_TTY_DBG("%s: the interface is not opened\n",cpc_tty->name); |
896 | return; | 896 | return; |
897 | } | 897 | } |
@@ -1027,7 +1027,7 @@ void cpc_tty_unregister_service(pc300dev_t *pc300dev) | |||
1027 | ulong flags; | 1027 | ulong flags; |
1028 | int res; | 1028 | int res; |
1029 | 1029 | ||
1030 | if ((cpc_tty= (st_cpc_tty_area *) pc300dev->cpc_tty) == 0) { | 1030 | if ((cpc_tty= (st_cpc_tty_area *) pc300dev->cpc_tty) == NULL) { |
1031 | CPC_TTY_DBG("%s: interface is not TTY\n", pc300dev->dev->name); | 1031 | CPC_TTY_DBG("%s: interface is not TTY\n", pc300dev->dev->name); |
1032 | return; | 1032 | return; |
1033 | } | 1033 | } |