diff options
author | David Woodhouse <dwmw2@shinybook.infradead.org> | 2005-05-05 08:59:37 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@shinybook.infradead.org> | 2005-05-05 08:59:37 -0400 |
commit | bfd4bda097f8758d28e632ff2035e25577f6b060 (patch) | |
tree | 022276b3625a432c7132e39776e7e448445087ac /drivers/pci/pci-driver.c | |
parent | 488f2eaca1b0831a5a5e6a66e33bad2cdeff7238 (diff) | |
parent | b2d84f078a8be40f5ae3b4d2ac001e2a7f45fe4f (diff) |
Merge with master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Diffstat (limited to 'drivers/pci/pci-driver.c')
-rw-r--r-- | drivers/pci/pci-driver.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index 37b7961efc44..fe98553c978f 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) | |||
318 | return 0; | 318 | return 0; |
319 | } | 319 | } |
320 | 320 | ||
321 | static void pci_device_shutdown(struct device *dev) | ||
322 | { | ||
323 | struct pci_dev *pci_dev = to_pci_dev(dev); | ||
324 | struct pci_driver *drv = pci_dev->driver; | ||
325 | |||
326 | if (drv && drv->shutdown) | ||
327 | drv->shutdown(pci_dev); | ||
328 | } | ||
321 | 329 | ||
322 | #define kobj_to_pci_driver(obj) container_of(obj, struct device_driver, kobj) | 330 | #define kobj_to_pci_driver(obj) container_of(obj, struct device_driver, kobj) |
323 | #define attr_to_driver_attribute(obj) container_of(obj, struct driver_attribute, attr) | 331 | #define attr_to_driver_attribute(obj) container_of(obj, struct driver_attribute, attr) |
@@ -373,7 +381,7 @@ pci_populate_driver_dir(struct pci_driver *drv) | |||
373 | * | 381 | * |
374 | * Adds the driver structure to the list of registered drivers. | 382 | * Adds the driver structure to the list of registered drivers. |
375 | * Returns a negative value on error, otherwise 0. | 383 | * Returns a negative value on error, otherwise 0. |
376 | * If no error occured, the driver remains registered even if | 384 | * If no error occurred, the driver remains registered even if |
377 | * no device was claimed during registration. | 385 | * no device was claimed during registration. |
378 | */ | 386 | */ |
379 | int pci_register_driver(struct pci_driver *drv) | 387 | int pci_register_driver(struct pci_driver *drv) |
@@ -385,6 +393,7 @@ int pci_register_driver(struct pci_driver *drv) | |||
385 | drv->driver.bus = &pci_bus_type; | 393 | drv->driver.bus = &pci_bus_type; |
386 | drv->driver.probe = pci_device_probe; | 394 | drv->driver.probe = pci_device_probe; |
387 | drv->driver.remove = pci_device_remove; | 395 | drv->driver.remove = pci_device_remove; |
396 | drv->driver.shutdown = pci_device_shutdown, | ||
388 | drv->driver.owner = drv->owner; | 397 | drv->driver.owner = drv->owner; |
389 | drv->driver.kobj.ktype = &pci_driver_kobj_type; | 398 | drv->driver.kobj.ktype = &pci_driver_kobj_type; |
390 | pci_init_dynids(&drv->dynids); | 399 | pci_init_dynids(&drv->dynids); |