public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] Fixup PCI driver shutdown
@ 2005-10-16 20:31 Russell King
  2005-10-16 20:32 ` [PATCH 2/2] Convert megaraid to use pci_driver shutdown method Russell King
  0 siblings, 1 reply; 2+ messages in thread
From: Russell King @ 2005-10-16 20:31 UTC (permalink / raw)
  To: Linux Kernel List, Andrew Morton, Greg KH

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>

diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -377,6 +377,9 @@ int pci_register_driver(struct pci_drive
 	 * the pci shutdown function, this test can go away. */
 	if (!drv->driver.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.kobj.ktype = &pci_driver_kobj_type;
 

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/2] Convert megaraid to use pci_driver shutdown method
  2005-10-16 20:31 [PATCH 1/2] Fixup PCI driver shutdown Russell King
@ 2005-10-16 20:32 ` Russell King
  0 siblings, 0 replies; 2+ messages in thread
From: Russell King @ 2005-10-16 20:32 UTC (permalink / raw)
  To: Linux Kernel List, Andrew Morton, Greg KH, Neela.Kolli

Convert megaraid to use pci_driver's shutdown method rather than
the generic device_driver shutdown method.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c
--- a/drivers/scsi/megaraid/megaraid_mbox.c
+++ b/drivers/scsi/megaraid/megaraid_mbox.c
@@ -76,7 +76,7 @@ static void megaraid_exit(void);
 
 static int megaraid_probe_one(struct pci_dev*, const struct pci_device_id *);
 static void megaraid_detach_one(struct pci_dev *);
-static void megaraid_mbox_shutdown(struct device *);
+static void megaraid_mbox_shutdown(struct pci_dev *);
 
 static int megaraid_io_attach(adapter_t *);
 static void megaraid_io_detach(adapter_t *);
@@ -369,9 +369,7 @@ static struct pci_driver megaraid_pci_dr
 	.id_table	= pci_id_table_g,
 	.probe		= megaraid_probe_one,
 	.remove		= __devexit_p(megaraid_detach_one),
-	.driver		= {
-		.shutdown	= megaraid_mbox_shutdown,
-	}
+	.shutdown	= megaraid_mbox_shutdown,
 };
 
 
@@ -673,9 +671,9 @@ megaraid_detach_one(struct pci_dev *pdev
  * Shutdown notification, perform flush cache
  */
 static void
-megaraid_mbox_shutdown(struct device *device)
+megaraid_mbox_shutdown(struct pci_dev *pdev)
 {
-	adapter_t		*adapter = pci_get_drvdata(to_pci_dev(device));
+	adapter_t		*adapter = pci_get_drvdata(pdev);
 	static int		counter;
 
 	if (!adapter) {

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-10-16 20:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-16 20:31 [PATCH 1/2] Fixup PCI driver shutdown Russell King
2005-10-16 20:32 ` [PATCH 2/2] Convert megaraid to use pci_driver shutdown method Russell King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox