From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753430AbbFAOaR (ORCPT ); Mon, 1 Jun 2015 10:30:17 -0400 Received: from mail-lb0-f173.google.com ([209.85.217.173]:33237 "EHLO mail-lb0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752243AbbFAOaM (ORCPT ); Mon, 1 Jun 2015 10:30:12 -0400 Date: Mon, 1 Jun 2015 16:30:13 +0200 From: Johan Hovold To: Abhishek Bist Cc: johan@kernel.org, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] USB-SERIAL : Changing usb_serial_generic_open prototype Message-ID: <20150601143013.GG27360@localhost> References: <1432991840-24152-1-git-send-email-ishubist@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1432991840-24152-1-git-send-email-ishubist@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > 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