Re: [RFC PATCH 4/6] serio: serport: add support for buffered write and receive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

> @@ -133,26 +133,29 @@ static void serport_ldisc_receive(struct tty_struct *tty, const unsigned char *c
>  	if (!test_bit(SERPORT_ACTIVE, &serport->flags))
>  		goto out;
>  
> -	for (i = 0; i < count; i++) {
> -		if (fp) {
> -			switch (fp[i]) {
> -			case TTY_FRAME:
> -				ch_flags = SERIO_FRAME;
> -				break;
> -
> -			case TTY_PARITY:
> -				ch_flags = SERIO_PARITY;
> -				break;
> -
> -			default:
> -				ch_flags = 0;
> -				break;
> +	if (serio_buffered_mode_enabled(serport->serio)) {
> +		serio_receive_buf(serport->serio, cp, count);

Elsewhere:
+       /* Use buffer receive if the driver provides a callback */
+       if (drv->receive_buf)
+               set_bit(SERIO_MODE_BUFFERED, &drv->flags);

Could we use if (drv->receive_buf) above directly, and not require the
bitfield?

Thanks,
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux