Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 56628
b: refs/heads/master
c: e9ca75b
h: refs/heads/master
v: v3
  • Loading branch information
Gerald Britton authored and Linus Torvalds committed May 19, 2007
1 parent 94519fb commit bc8294b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dec04cff500d4e543c55ab1beb0af85d8ed7e6bd
refs/heads/master: e9ca75b53576ddf82ea2d803f87c59dffac7bc42
45 changes: 30 additions & 15 deletions trunk/drivers/block/cciss.c
Original file line number Diff line number Diff line change
Expand Up @@ -3469,13 +3469,39 @@ static int __devinit cciss_init_one(struct pci_dev *pdev,
return -1;
}

static void cciss_remove_one(struct pci_dev *pdev)
static void cciss_shutdown(struct pci_dev *pdev)
{
ctlr_info_t *tmp_ptr;
int i, j;
int i;
char flush_buf[4];
int return_code;

tmp_ptr = pci_get_drvdata(pdev);
if (tmp_ptr == NULL)
return;
i = tmp_ptr->ctlr;
if (hba[i] == NULL)
return;

/* Turn board interrupts off and send the flush cache command */
/* sendcmd will turn off interrupt, and send the flush...
* To write all data in the battery backed cache to disks */
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_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]);
}

static void __devexit cciss_remove_one(struct pci_dev *pdev)
{
ctlr_info_t *tmp_ptr;
int i, j;

if (pci_get_drvdata(pdev) == NULL) {
printk(KERN_ERR "cciss: Unable to remove device \n");
return;
Expand Down Expand Up @@ -3506,18 +3532,7 @@ static void cciss_remove_one(struct pci_dev *pdev)

cciss_unregister_scsi(i); /* unhook from SCSI subsystem */

/* Turn board interrupts off and send the flush cache command */
/* sendcmd will turn off interrupt, and send the flush...
* To write all data in the battery backed cache to disks */
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_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]);
cciss_shutdown(pdev);

#ifdef CONFIG_PCI_MSI
if (hba[i]->msix_vector)
Expand Down Expand Up @@ -3550,7 +3565,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,
.shutdown = cciss_shutdown,
};

/*
Expand Down

0 comments on commit bc8294b

Please sign in to comment.