diff options
Diffstat (limited to 'drivers/net/irda/irtty-sir.c')
-rw-r--r-- | drivers/net/irda/irtty-sir.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/net/irda/irtty-sir.c b/drivers/net/irda/irtty-sir.c index 3352b2443e58..035861d8acb1 100644 --- a/drivers/net/irda/irtty-sir.c +++ b/drivers/net/irda/irtty-sir.c | |||
@@ -216,23 +216,23 @@ static int irtty_do_write(struct sir_dev *dev, const unsigned char *ptr, size_t | |||
216 | * usbserial: urb-complete-interrupt / softint | 216 | * usbserial: urb-complete-interrupt / softint |
217 | */ | 217 | */ |
218 | 218 | ||
219 | static void irtty_receive_buf(struct tty_struct *tty, const unsigned char *cp, | 219 | static unsigned int irtty_receive_buf(struct tty_struct *tty, |
220 | char *fp, int count) | 220 | const unsigned char *cp, char *fp, int count) |
221 | { | 221 | { |
222 | struct sir_dev *dev; | 222 | struct sir_dev *dev; |
223 | struct sirtty_cb *priv = tty->disc_data; | 223 | struct sirtty_cb *priv = tty->disc_data; |
224 | int i; | 224 | int i; |
225 | 225 | ||
226 | IRDA_ASSERT(priv != NULL, return;); | 226 | IRDA_ASSERT(priv != NULL, return -ENODEV;); |
227 | IRDA_ASSERT(priv->magic == IRTTY_MAGIC, return;); | 227 | IRDA_ASSERT(priv->magic == IRTTY_MAGIC, return -EINVAL;); |
228 | 228 | ||
229 | if (unlikely(count==0)) /* yes, this happens */ | 229 | if (unlikely(count==0)) /* yes, this happens */ |
230 | return; | 230 | return 0; |
231 | 231 | ||
232 | dev = priv->dev; | 232 | dev = priv->dev; |
233 | if (!dev) { | 233 | if (!dev) { |
234 | IRDA_WARNING("%s(), not ready yet!\n", __func__); | 234 | IRDA_WARNING("%s(), not ready yet!\n", __func__); |
235 | return; | 235 | return -ENODEV; |
236 | } | 236 | } |
237 | 237 | ||
238 | for (i = 0; i < count; i++) { | 238 | for (i = 0; i < count; i++) { |
@@ -242,11 +242,13 @@ static void irtty_receive_buf(struct tty_struct *tty, const unsigned char *cp, | |||
242 | if (fp && *fp++) { | 242 | if (fp && *fp++) { |
243 | IRDA_DEBUG(0, "Framing or parity error!\n"); | 243 | IRDA_DEBUG(0, "Framing or parity error!\n"); |
244 | sirdev_receive(dev, NULL, 0); /* notify sir_dev (updating stats) */ | 244 | sirdev_receive(dev, NULL, 0); /* notify sir_dev (updating stats) */ |
245 | return; | 245 | return -EINVAL; |
246 | } | 246 | } |
247 | } | 247 | } |
248 | 248 | ||
249 | sirdev_receive(dev, cp, count); | 249 | sirdev_receive(dev, cp, count); |
250 | |||
251 | return count; | ||
250 | } | 252 | } |
251 | 253 | ||
252 | /* | 254 | /* |