summaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci-driver.c
diff options
context:
space:
mode:
authorGreg KH <gregkh@suse.de>2005-04-08 14:53:31 +0900
committerGreg KH <gregkh@suse.de>2005-05-03 23:45:15 -0700
commitc8958177224622411b9979eabb5610e30b06034b (patch)
tree09ceb4ce69813c9ac2a3e3c7ea6eff9d5361fe9c /drivers/pci/pci-driver.c
parent4c0619add8c3a8b28e7fae8b15cc7b62de2f8148 (diff)
downloadtalos-op-linux-c8958177224622411b9979eabb5610e30b06034b.tar.gz
talos-op-linux-c8958177224622411b9979eabb5610e30b06034b.zip
[PATCH] PCI: Add pci shutdown ability
Now pci drivers can know when the system is going down without having to add a reboot notifier event. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/pci-driver.c')
-rw-r--r--drivers/pci/pci-driver.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index 37b7961efc44..b42466ccbb30 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -318,6 +318,14 @@ static int pci_device_resume(struct device * dev)
return 0;
}
+static void pci_device_shutdown(struct device *dev)
+{
+ struct pci_dev *pci_dev = to_pci_dev(dev);
+ struct pci_driver *drv = pci_dev->driver;
+
+ if (drv && drv->shutdown)
+ drv->shutdown(pci_dev);
+}
#define kobj_to_pci_driver(obj) container_of(obj, struct device_driver, kobj)
#define attr_to_driver_attribute(obj) container_of(obj, struct driver_attribute, attr)
@@ -385,6 +393,7 @@ int pci_register_driver(struct pci_driver *drv)
drv->driver.bus = &pci_bus_type;
drv->driver.probe = pci_device_probe;
drv->driver.remove = pci_device_remove;
+ drv->driver.shutdown = pci_device_shutdown,
drv->driver.owner = drv->owner;
drv->driver.kobj.ktype = &pci_driver_kobj_type;
pci_init_dynids(&drv->dynids);
OpenPOWER on IntegriCloud