From patchwork Wed Dec 5 10:30:59 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Whitcroft X-Patchwork-Id: 203827 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id C7E292C00C4 for ; Wed, 5 Dec 2012 21:31:23 +1100 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TgCG2-0003QT-5t; Wed, 05 Dec 2012 10:31:14 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TgCFt-0003Mg-R1 for kernel-team@lists.ubuntu.com; Wed, 05 Dec 2012 10:31:05 +0000 Received: from 79-78-214-112.dynamic.dsl.as9105.com ([79.78.214.112] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1TgCFt-0000TU-In; Wed, 05 Dec 2012 10:31:05 +0000 From: Andy Whitcroft To: kernel-team@lists.ubuntu.com Subject: [PATCH 5/5] UBUNTU: SAUCE: ata_piix: add a disable_driver option Date: Wed, 5 Dec 2012 10:30:59 +0000 Message-Id: <1354703459-10835-6-git-send-email-apw@canonical.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1354703459-10835-1-git-send-email-apw@canonical.com> References: <1354703459-10835-1-git-send-email-apw@canonical.com> Cc: Andy Whitcroft X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com We need to be able to fully disable the ata_piix driver from the kernel command line. Add a generic disable_driver to the module init to completely short circuit the initialisation. BugLink: http://bugs.launchpad.net/bugs/994870 Signed-off-by: Andy Whitcroft Acked-by: Luis Henriques Acked-by: Herton Krzesinski Acked-by: Brad Figg Signed-off-by: Tim Gardner Signed-off-by: Leann Ogasawara BugLink: http://bugs.launchpad.net/bugs/1079084 Signed-off-by: Andy Whitcroft --- drivers/ata/ata_piix.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c index 8fea06b..09fff97 100644 --- a/drivers/ata/ata_piix.c +++ b/drivers/ata/ata_piix.c @@ -1717,10 +1717,16 @@ static void piix_remove_one(struct pci_dev *pdev) ata_pci_remove_one(pdev); } +static bool disable_driver = 0; static int __init piix_init(void) { int rc; + if (disable_driver) { + printk(KERN_WARNING "ata_piix: driver disabled completely\n"); + return 0; + } + DPRINTK("pci_register_driver\n"); rc = pci_register_driver(&piix_pci_driver); if (rc) @@ -1737,5 +1743,6 @@ static void __exit piix_exit(void) pci_unregister_driver(&piix_pci_driver); } +module_param(disable_driver, bool, 0); module_init(piix_init); module_exit(piix_exit);