From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754472AbdEJTmb (ORCPT ); Wed, 10 May 2017 15:42:31 -0400 Received: from www.llwyncelyn.cymru ([82.70.14.225]:36128 "EHLO fuzix.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753492AbdEJTm3 (ORCPT ); Wed, 10 May 2017 15:42:29 -0400 Date: Wed, 10 May 2017 20:41:51 +0100 From: Alan Cox To: okash.khawaja@gmail.com Cc: Greg Kroah-Hartman , Samuel Thibault , linux-kernel@vger.kernel.org, William Hubbs , Chris Brannon , Kirk Reiser , speakup@linux-speakup.org, devel@driverdev.osuosl.org, John Covici Subject: Re: [patch 1/1] staging: speakup: flush tty buffers and ensure hardware flow control Message-ID: <20170510204151.43986689@alans-desktop> In-Reply-To: <20170509124238.139472887@gmail.com> References: <20170509124040.816526511@gmail.com> <20170509124238.139472887@gmail.com> Organization: Intel Corporation X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > + if (!(tmp_termios.c_cflag & CRTSCTS)) { > + tmp_termios.c_cflag |= CRTSCTS; > + ret = tty_set_termios(tty, &tmp_termios); > + if (ret) > + pr_warn("speakup: Failed to set hardware flow control\n"); You should check the tty c_cflag after the call rather than rely on an error code. Strictly speaking tty_set_termios should error if no tty bits are changed by the request but it never has on Linux. Instead check the tty gave you the result you wanted. Alan