From patchwork Tue Oct 13 23:06:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Gortmaker X-Patchwork-Id: 529942 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 8964A140E43 for ; Wed, 14 Oct 2015 10:07:44 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 6D20F1A0837 for ; Wed, 14 Oct 2015 10:07:44 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail1.windriver.com (mail1.windriver.com [147.11.146.13]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 1C5941A0806 for ; Wed, 14 Oct 2015 10:06:49 +1100 (AEDT) Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail1.windriver.com (8.15.2/8.15.1) with ESMTPS id t9DN6jL4017476 (version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL); Tue, 13 Oct 2015 16:06:45 -0700 (PDT) Received: from yow-lpgnfs-02.corp.ad.wrs.com (128.224.149.8) by ALA-HCA.corp.ad.wrs.com (147.11.189.40) with Microsoft SMTP Server id 14.3.248.2; Tue, 13 Oct 2015 16:06:45 -0700 From: Paul Gortmaker To: Subject: [PATCH] tty: disable unbind for old 74xx based serial/mpsc console port Date: Tue, 13 Oct 2015 19:06:30 -0400 Message-ID: <1444777590-15674-1-git-send-email-paul.gortmaker@windriver.com> X-Mailer: git-send-email 2.6.1 MIME-Version: 1.0 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Greg Kroah-Hartman , Paul Gortmaker , Thierry Reding , linux-serial@vger.kernel.org, Jiri Slaby , linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" We recently got rid of some modular code in this driver and also got rid of the unused ".remove" function at the same time. Thierry noted that it was however possible to force the remove through the bind/unbind interface. Since this is a console device used on 2005 vintage 74xx based powerpc embedded targets, and is essentially always used in conjunction with SERIAL_MPSC_CONSOLE=y -- there is no sane reason anyone would ever want to unbind the builtin driver and lose the console. So we just explicitly block bind/unbind operations and prevent root from shooting themselves in the foot. Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: Thierry Reding Cc: linux-serial@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Paul Gortmaker --- drivers/tty/serial/mpsc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/mpsc.c b/drivers/tty/serial/mpsc.c index 2f43a58cb392..cadfd1cfae2b 100644 --- a/drivers/tty/serial/mpsc.c +++ b/drivers/tty/serial/mpsc.c @@ -2109,7 +2109,8 @@ static int mpsc_drv_probe(struct platform_device *dev) static struct platform_driver mpsc_driver = { .probe = mpsc_drv_probe, .driver = { - .name = MPSC_CTLR_NAME, + .name = MPSC_CTLR_NAME, + .suppress_bind_attrs = true, }, };