浏览代码

[PATCH] PCI: Fixup PCI driver shutdown

Add a warning to pci driver registration code so that we know
whether we have drivers using the obsolete driver shutdown
method.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Russell King 19 年之前
父节点
当前提交
a1720fdbd0
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      drivers/pci/pci-driver.c

+ 4 - 0
drivers/pci/pci-driver.c

@@ -377,6 +377,10 @@ int pci_register_driver(struct pci_driver *drv)
 	 * the pci shutdown function, this test can go away. */
 	 * the pci shutdown function, this test can go away. */
 	if (!drv->driver.shutdown)
 	if (!drv->driver.shutdown)
 		drv->driver.shutdown = pci_device_shutdown;
 		drv->driver.shutdown = pci_device_shutdown;
+	else
+		printk(KERN_WARNING "Warning: PCI driver %s has a struct "
+			"device_driver shutdown method, please update!\n",
+			drv->name);
 	drv->driver.owner = drv->owner;
 	drv->driver.owner = drv->owner;
 	drv->driver.kobj.ktype = &pci_driver_kobj_type;
 	drv->driver.kobj.ktype = &pci_driver_kobj_type;