]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] cciss: add struct pci_driver shutdown support (replaces reboot notifier)
authorMike Miller (OS Dev) <mikem@beardog.cca.cpqcorp.net>
Tue, 6 Mar 2007 09:42:16 +0000 (01:42 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 6 Mar 2007 17:30:25 +0000 (09:30 -0800)
This patch adds support for the struct pci_driver shutdown method to cciss.
 We require notification of an impending reboot or shutdown so that we can
flush the battery backed write cache (BBWC) on the Smart Array controller.

Signed-off-by: Mike Miller <mike.miller@hp.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/block/cciss.c

index 8791e43cad5d9573e9fea87b71a8bd424a23b7a0..0c716ee905d74273c92362f28b29abd74264858b 100644 (file)
@@ -3404,7 +3404,7 @@ static int __devinit cciss_init_one(struct pci_dev *pdev,
        return -1;
 }
 
-static void __devexit cciss_remove_one(struct pci_dev *pdev)
+static void cciss_remove_one(struct pci_dev *pdev)
 {
        ctlr_info_t *tmp_ptr;
        int i, j;
@@ -3428,9 +3428,10 @@ static void __devexit cciss_remove_one(struct pci_dev *pdev)
        memset(flush_buf, 0, 4);
        return_code = sendcmd(CCISS_CACHE_FLUSH, i, flush_buf, 4, 0, 0, 0, NULL,
                              TYPE_CMD);
-       if (return_code != IO_OK) {
-               printk(KERN_WARNING "Error Flushing cache on controller %d\n",
-                      i);
+       if (return_code == IO_OK) {
+               printk(KERN_INFO "Completed flushing cache on controller %d\n", i);
+       } else {
+               printk(KERN_WARNING "Error flushing cache on controller %d\n", i);
        }
        free_irq(hba[i]->intr[2], hba[i]);
 
@@ -3481,6 +3482,7 @@ static struct pci_driver cciss_pci_driver = {
        .probe = cciss_init_one,
        .remove = __devexit_p(cciss_remove_one),
        .id_table = cciss_pci_device_id,        /* id_table */
+       .shutdown = cciss_remove_one,
 };
 
 /*