Re: [PATCH] iuu_phoenix - new release v0.4 - call for review/comments

Alan Cox <[email protected]>
Newsgroups gmane.linux.usb.devel
Organization Red Hat UK Cyf., Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, Y Deyrnas Gyfunol. Cofrestrwyd yng Nghymru a Lloegr o'r rhif cofrestru 3798903
Message-ID <[email protected]>
> +static int
> +iuu_ioctl(struct usb_serial_port *port, struct file *file, unsigned int cmd,
> +	  unsigned long arg)
> +{
> +

This is very wrong. Your driver may not intercept TCGETS and similar
ioctls. In fact you don't seem to need any of it. Terminal changes are
handled by the set_termios callback you provide. I'd just delete the
ioctl method for now (note a lot of other usb serial drivers get it wrong
and I'm busy cleaning them all up)

> +	if (tty && urb->actual_length && data != NULL ) {
> +		tty_buffer_request_room(tty, urb->actual_length + 1);
> +		for (i = 0; i < urb->actual_length; ++i)
> +			tty_insert_flip_char(tty, data[i], TTY_NORMAL);

We've got tty_insert_flip_string for this case which is a bit simpler.
You can just do

	if (tty) {
		tty_insert_flip_string(tty, data, urb->actual_length);
		tty_flip_buffer_push(tty);
	}

> +static int
> +iuu_uart_baud(struct usb_serial_port *port, u_int32_t baud, u_int32_t *actual,
> +	      u_int8_t parity)

u32 not u_int32_t by preference (or in fact we have speed_t for speeds)


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.