From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754360AbcDYKdV (ORCPT ); Mon, 25 Apr 2016 06:33:21 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:34442 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752299AbcDYKdT (ORCPT ); Mon, 25 Apr 2016 06:33:19 -0400 Date: Mon, 25 Apr 2016 12:33:17 +0200 From: Johan Hovold To: Konstantin Shkolnyy Cc: johan@kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH RESEND 4/5] USB: serial: cp210x: Prepared get_termios() for adding error handling Message-ID: <20160425103317.GL18866@localhost> References: <1461517770-6275-1-git-send-email-konstantin.shkolnyy@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1461517770-6275-1-git-send-email-konstantin.shkolnyy@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Apr 24, 2016 at 12:09:30PM -0500, Konstantin Shkolnyy wrote: > Replaced several register write calls with one, to simplify adding error > handling. > > Signed-off-by: Konstantin Shkolnyy > --- > drivers/usb/serial/cp210x.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c > index b2321a7..58cffc9 100644 > --- a/drivers/usb/serial/cp210x.c > +++ b/drivers/usb/serial/cp210x.c > @@ -692,6 +692,7 @@ static void cp210x_get_termios_port(struct usb_serial_port *port, Instead of cleaning up cp210x_get_termios I think you should consider removing it. It is used to read the current settings from the device and in case we have a tty at open, to update the termios settings to match. Instead you should just make sure that the device settings match termios (and this is in fact already implemented, but done after retrieving the settings). You can also implement the init_termios callback to provide defaults that match the hardware reset values. Thanks, Johan