lkml.org 
[lkml]   [2015]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/1] USB-SERIAL : Changing usb_serial_generic_open prototype
On Sat, May 30, 2015 at 06:47:20PM +0530, Abhishek Bist wrote:
> While designing a usb to uart converter driver open function I am using
> usb_serial_generic_open, but wouldn't find need to pass tty as an argument.
> As it is not performing any task for further significance.
> So, This patch proposed a change in usb_serial_generic_open
> function prototype which has struct tty_struct as a first argument.
>
> usb_serial_generic_open(struct tty_struct *tty,
> struct usb_serial_port *port);
>
> Signed-off-by: Abhishek Bist <ishubist@gmail.com>

> diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h
> index 704a1ab..c8ed44a 100644
> --- a/include/linux/usb/serial.h
> +++ b/include/linux/usb/serial.h
> @@ -318,8 +318,7 @@ static inline void usb_serial_console_disconnect(struct usb_serial *serial) {}
> /* Functions needed by other parts of the usbserial core */
> extern struct usb_serial_port *usb_serial_port_get_by_minor(unsigned int minor);
> extern void usb_serial_put(struct usb_serial *serial);
> -extern int usb_serial_generic_open(struct tty_struct *tty,
> - struct usb_serial_port *port);
> +extern int usb_serial_generic_open(struct usb_serial_port *port);
> extern int usb_serial_generic_write_start(struct usb_serial_port *port,
> gfp_t mem_flags);
> extern int usb_serial_generic_write(struct tty_struct *tty,

This does not work as usb_serial_generic_open is the default driver
callback.

If you had compile tested your patch you would have seen the following
warning:

linux/drivers/usb/serial/usb-serial.c: In function 'usb_serial_operations_init':
linux/drivers/usb/serial/usb-serial.c:1318:19: warning: assignment from incompatible pointer type
type->function = usb_serial_generic_##function; \
^
linux/drivers/usb/serial/usb-serial.c:1326:2: note: in expansion of macro 'set_to_generic_if_null'
set_to_generic_if_null(device, open);
^

Johan


\
 
 \ /
  Last update: 2015-06-01 17:21    [W:2.211 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site