aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/gasket
diff options
context:
space:
mode:
authorTodd Poynor <toddpoynor@google.com>2018-08-05 13:07:42 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-08-08 11:20:07 +0200
commit38da89d5cc958d2b0cf03c237cd155ab08973b1a (patch)
tree84f205917e86a129d85a4dab4ab04fa7266d7de7 /drivers/staging/gasket
parentstaging: gasket: core: let device driver enable/disable gasket device (diff)
downloadlinux-dev-38da89d5cc958d2b0cf03c237cd155ab08973b1a.tar.xz
linux-dev-38da89d5cc958d2b0cf03c237cd155ab08973b1a.zip
staging: gasket: apex: enable/disable gasket device from apex
Gasket framework now places device drivers in charge of calling APIs to enable and disable gasket device operations. Make the appropriate calls from the apex driver. Signed-off-by: Todd Poynor <toddpoynor@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/gasket')
-rw-r--r--drivers/staging/gasket/apex_driver.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/staging/gasket/apex_driver.c b/drivers/staging/gasket/apex_driver.c
index e2bc06b5244f..1d8a100c5288 100644
--- a/drivers/staging/gasket/apex_driver.c
+++ b/drivers/staging/gasket/apex_driver.c
@@ -643,11 +643,23 @@ static int apex_pci_probe(struct pci_dev *pci_dev,
return ret;
}
+ pci_set_drvdata(pci_dev, gasket_dev);
+ ret = gasket_enable_device(gasket_dev);
+ if (ret) {
+ dev_err(&pci_dev->dev, "error enabling gasket device\n");
+ gasket_pci_remove_device(pci_dev);
+ pci_disable_device(pci_dev);
+ return ret;
+ }
+
return 0;
}
static void apex_pci_remove(struct pci_dev *pci_dev)
{
+ struct gasket_dev *gasket_dev = pci_get_drvdata(pci_dev);
+
+ gasket_disable_device(gasket_dev);
gasket_pci_remove_device(pci_dev);
pci_disable_device(pci_dev);
}