aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci-driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/pci-driver.c')
-rw-r--r--drivers/pci/pci-driver.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index 0aa14c92b570..f22f69ac6445 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -53,11 +53,10 @@ store_new_id(struct device_driver *driver, const char *buf, size_t count)
53 if (fields < 0) 53 if (fields < 0)
54 return -EINVAL; 54 return -EINVAL;
55 55
56 dynid = kmalloc(sizeof(*dynid), GFP_KERNEL); 56 dynid = kzalloc(sizeof(*dynid), GFP_KERNEL);
57 if (!dynid) 57 if (!dynid)
58 return -ENOMEM; 58 return -ENOMEM;
59 59
60 memset(dynid, 0, sizeof(*dynid));
61 INIT_LIST_HEAD(&dynid->node); 60 INIT_LIST_HEAD(&dynid->node);
62 dynid->id.vendor = vendor; 61 dynid->id.vendor = vendor;
63 dynid->id.device = device; 62 dynid->id.device = device;
@@ -380,14 +379,6 @@ int __pci_register_driver(struct pci_driver *drv, struct module *owner)
380 /* initialize common driver fields */ 379 /* initialize common driver fields */
381 drv->driver.name = drv->name; 380 drv->driver.name = drv->name;
382 drv->driver.bus = &pci_bus_type; 381 drv->driver.bus = &pci_bus_type;
383 /* FIXME, once all of the existing PCI drivers have been fixed to set
384 * the pci shutdown function, this test can go away. */
385 if (!drv->driver.shutdown)
386 drv->driver.shutdown = pci_device_shutdown;
387 else
388 printk(KERN_WARNING "Warning: PCI driver %s has a struct "
389 "device_driver shutdown method, please update!\n",
390 drv->name);
391 drv->driver.owner = owner; 382 drv->driver.owner = owner;
392 drv->driver.kobj.ktype = &pci_driver_kobj_type; 383 drv->driver.kobj.ktype = &pci_driver_kobj_type;
393 384
@@ -514,6 +505,7 @@ struct bus_type pci_bus_type = {
514 .probe = pci_device_probe, 505 .probe = pci_device_probe,
515 .remove = pci_device_remove, 506 .remove = pci_device_remove,
516 .suspend = pci_device_suspend, 507 .suspend = pci_device_suspend,
508 .shutdown = pci_device_shutdown,
517 .resume = pci_device_resume, 509 .resume = pci_device_resume,
518 .dev_attrs = pci_dev_attrs, 510 .dev_attrs = pci_dev_attrs,
519}; 511};