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: 5705411 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 74B979F1D6 for ; Sun, 25 Jan 2015 19:47:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8ECE620125 for ; Sun, 25 Jan 2015 19:47:51 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AE9522013A for ; Sun, 25 Jan 2015 19:47:50 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YFT8L-0008LM-0S; Sun, 25 Jan 2015 19:46:09 +0000 Received: from mail-qg0-f50.google.com ([209.85.192.50]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YFT7j-0008C2-Bz for linux-arm-kernel@lists.infradead.org; Sun, 25 Jan 2015 19:45:32 +0000 Received: by mail-qg0-f50.google.com with SMTP id f51so4390302qge.9 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=dLEYwRpmI2cjVSSTwjvSHkmOT8LTrPrrHnFM2m3SBuFXIWqsEYusdPmWylMOHYoxRk kN1HaB+iNewPx7OYNKJbZzvDAKutwN00nnP8W3gqYAtnvUm7oTNCa57sEcgI1t29dgQy lS0j/h9i9f3Gb27yFVTCbAxtazb/NjDIATHnRKgFidnVFWZ72x8XTWQnofj1qBUT5BAc 7CSTExGjpgd0TK0QZ6JEbdNkZS/WRWg0YiJ2NI1bNm7UuCyMkN5KLKGqP1l226KSNh0z w8pzRzN/M8DvZP0FyTeg1foGVKoYnJ30PlNa13BQ2eTaHOQbN8ZKcCtSc6INLZEBSW0y KnxA== X-Gm-Message-State: ALoCoQnY8sAmqcESA1imRpZXFUzgjkSLpSCfXaeqNkwZApqMWuda1rMR4f2Qe8AG5monkfJzpKn3 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150125_114531_525100_A88815F4 X-CRM114-Status: GOOD ( 13.07 ) X-Spam-Score: -0.7 (/) Cc: Peter Hurley , Marcel Holtmann , linux-bluetooth@vger.kernel.org, linux-serial@vger.kernel.org, linux-omap@vger.kernel.org, Jiri Slaby , linux-arm-kernel@lists.infradead.org, Johan Hedberg X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 *);