[PATCH 5/5] UBUNTU: SAUCE: ata_piix: add a disable_driver option
Andy Whitcroft
apw at canonical.com
Wed Dec 5 10:30:59 UTC 2012
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 <apw at canonical.com>
Acked-by: Luis Henriques <luis.henriques at canonical.com>
Acked-by: Herton Krzesinski <herton.krzesinski at canonical.com>
Acked-by: Brad Figg <brad.figg at canonical.com>
Signed-off-by: Tim Gardner <tim.gardner at canonical.com>
Signed-off-by: Leann Ogasawara <leann.ogasawara at canonical.com>
BugLink: http://bugs.launchpad.net/bugs/1079084
Signed-off-by: Andy Whitcroft <apw at canonical.com>
---
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);
--
1.7.10.4
More information about the kernel-team
mailing list