From patchwork Sun Jan 25 19:44:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Hurley X-Patchwork-Id: 5705381 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 95B93C058D for ; Sun, 25 Jan 2015 19:45:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BDAA720125 for ; Sun, 25 Jan 2015 19:45:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7F9FB20172 for ; Sun, 25 Jan 2015 19:45:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756064AbbAYTp3 (ORCPT ); Sun, 25 Jan 2015 14:45:29 -0500 Received: from mail-qg0-f52.google.com ([209.85.192.52]:56546 "EHLO mail-qg0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755999AbbAYTpK (ORCPT ); Sun, 25 Jan 2015 14:45:10 -0500 Received: by mail-qg0-f52.google.com with SMTP id z107so4380768qgd.11 for ; Sun, 25 Jan 2015 11:45:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=89LLZIg+VgwmRqat8+g1U2d96+RjlYwqj5CSn4Vl+zQ=; b=RZtKfj7lIcxa065XOY46VGqOj9nUpquXgWGBiPR1kaSG6jACKMobBoZNG93CmVyegm +QqMOZdkPoYxiWsD/JGog0Lqq5dJuNjgNAhv5Spx4IldI65UCdM3DmASGRqvMFqG+6rI F9t7unbyybs/U10K2Eki3ZTBFKC6yh4790xkmZ7Ef98ZDmdKsEunZdRHIdjkRHEgSTla mqMo8GK5xIPr35/o+kOb7GNDoqwVVR9bQ4+THWa4drBy+YPlc3ZhcvVAQLFixLj2sVth QRNTTIhhQCbnGtDPwKtu3hSeok3Bsb7rG9tJ97iQu9BQ0Oqs4hRLozEBUmBSyoncAt87 8OZg== X-Gm-Message-State: ALoCoQniVf3lMUvtItI5YrokzxJxxHqu5V0FtydpysEgGKqUNXDhxF+IGEP2hw/FuLC4TzB/MLhh X-Received: by 10.224.223.197 with SMTP id il5mr34446100qab.5.1422215109517; Sun, 25 Jan 2015 11:45:09 -0800 (PST) Received: from thor.lan (h96-61-87-245.cntcnh.dsl.dynamic.tds.net. [96.61.87.245]) by mx.google.com with ESMTPSA id g100sm7886794qge.1.2015.01.25.11.45.08 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 25 Jan 2015 11:45:09 -0800 (PST) From: Peter Hurley To: Greg Kroah-Hartman Cc: linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, Jiri Slaby , Peter Hurley , Marcel Holtmann , Johan Hedberg , Subject: [PATCH 4/4] tty: Remove external interface for tty_set_termios() Date: Sun, 25 Jan 2015 14:44:54 -0500 Message-Id: <1422215094-3216-5-git-send-email-peter@hurleysoftware.com> X-Mailer: git-send-email 2.2.2 In-Reply-To: <1422215094-3216-1-git-send-email-peter@hurleysoftware.com> References: <1422215094-3216-1-git-send-email-peter@hurleysoftware.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP tty_set_termios() is an internal helper intended for file scope use. UART drivers which are capable of driving the RTS pin must properly handle the tiocmset() method, regardless of termios settings. A failure to do so is a UART driver bug and should be fixed there. Do not use this interface to workaround UART driver bugs. Cc: Marcel Holtmann Cc: Johan Hedberg Cc: Signed-off-by: Peter Hurley Acked-by: Marcel Holtmann --- drivers/bluetooth/hci_ath.c | 15 ++------------- drivers/tty/tty_ioctl.c | 3 +-- include/linux/tty.h | 1 - 3 files changed, 3 insertions(+), 16 deletions(-) diff --git a/drivers/bluetooth/hci_ath.c b/drivers/bluetooth/hci_ath.c index 2ff6dfd..9c4dcf4 100644 --- a/drivers/bluetooth/hci_ath.c +++ b/drivers/bluetooth/hci_ath.c @@ -51,33 +51,22 @@ struct ath_struct { static int ath_wakeup_ar3k(struct tty_struct *tty) { - struct ktermios ktermios; int status = tty->driver->ops->tiocmget(tty); if (status & TIOCM_CTS) return status; - /* Disable Automatic RTSCTS */ - ktermios = tty->termios; - ktermios.c_cflag &= ~CRTSCTS; - tty_set_termios(tty, &ktermios); - /* Clear RTS first */ - status = tty->driver->ops->tiocmget(tty); + tty->driver->ops->tiocmget(tty); tty->driver->ops->tiocmset(tty, 0x00, TIOCM_RTS); mdelay(20); /* Set RTS, wake up board */ - status = tty->driver->ops->tiocmget(tty); + tty->driver->ops->tiocmget(tty); tty->driver->ops->tiocmset(tty, TIOCM_RTS, 0x00); mdelay(20); status = tty->driver->ops->tiocmget(tty); - - /* Enable Automatic RTSCTS */ - ktermios.c_cflag |= CRTSCTS; - status = tty_set_termios(tty, &ktermios); - return status; } diff --git a/drivers/tty/tty_ioctl.c b/drivers/tty/tty_ioctl.c index d73f695..69fc0b8 100644 --- a/drivers/tty/tty_ioctl.c +++ b/drivers/tty/tty_ioctl.c @@ -533,7 +533,7 @@ EXPORT_SYMBOL(tty_termios_hw_change); * Locking: termios_rwsem */ -int tty_set_termios(struct tty_struct *tty, struct ktermios *new_termios) +static int tty_set_termios(struct tty_struct *tty, struct ktermios *new_termios) { struct ktermios old_termios; struct tty_ldisc *ld; @@ -566,7 +566,6 @@ int tty_set_termios(struct tty_struct *tty, struct ktermios *new_termios) up_write(&tty->termios_rwsem); return 0; } -EXPORT_SYMBOL_GPL(tty_set_termios); /** * set_termios - set termios values for a tty diff --git a/include/linux/tty.h b/include/linux/tty.h index 0992238..8c316b6 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h @@ -491,7 +491,6 @@ static inline speed_t tty_get_baud_rate(struct tty_struct *tty) extern void tty_termios_copy_hw(struct ktermios *new, struct ktermios *old); extern int tty_termios_hw_change(struct ktermios *a, struct ktermios *b); -extern int tty_set_termios(struct tty_struct *tty, struct ktermios *kt); extern struct tty_ldisc *tty_ldisc_ref(struct tty_struct *); extern void tty_ldisc_deref(struct tty_ldisc *);