Enable/Disable ISMT driver through module parameter.

This commit is contained in:
Jeffrey Townsend
2016-12-21 15:28:35 +00:00
parent 6ab5f38d33
commit bb5c865b97
2 changed files with 28 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
diff -urpN a/drivers/i2c/busses/i2c-ismt.c b/drivers/i2c/busses/i2c-ismt.c
--- a/drivers/i2c/busses/i2c-ismt.c 2016-12-21 02:12:49.589201206 +0000
+++ b/drivers/i2c/busses/i2c-ismt.c 2016-12-21 02:15:03.973204122 +0000
@@ -200,6 +200,11 @@ MODULE_PARM_DESC(bus_speed, "Bus Speed i
module_param(delay, uint, S_IRUGO);
MODULE_PARM_DESC(delay, "Delay in microsecs before access (1000 by default)");
+/* Enable/Disable driver */
+static unsigned int enable = 1;
+module_param(enable, uint, S_IRUGO);
+MODULE_PARM_DESC(enable, "Enable or disable the ISMT driver (enabled by default)");
+
/**
* __ismt_desc_dump() - dump the contents of a specific descriptor
*/
@@ -852,6 +857,11 @@ ismt_probe(struct pci_dev *pdev, const s
struct ismt_priv *priv;
unsigned long start, len;
+ if(!enable) {
+ dev_warn(&pdev->dev, "module is disabled.\n");
+ return -ENODEV;
+ }
+
priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
if (!priv)
return -ENOMEM;

View File

@@ -13,3 +13,4 @@ driver-arista-piix4-mux-patch.patch
3.16-fs-overlayfs.patch
driver-igb-version-5.3.54.patch
driver-support-intel-igb-bcm5461X-phy.patch
driver-i2c-bus-intel-ismt-enable-param.patch