Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 29790
b: refs/heads/master
c: c33ac89
h: refs/heads/master
v: v3
  • Loading branch information
Bjorn Helgaas authored and Linus Torvalds committed Jun 25, 2006
1 parent a778204 commit fcab81e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 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: e7b69055820a221d7da29092fd553fd7cd6a97d1
refs/heads/master: c33ac89bc7d697e23ce09ddae73e0ece5f65ad48
27 changes: 18 additions & 9 deletions trunk/drivers/block/cciss.c
Original file line number Diff line number Diff line change
Expand Up @@ -2744,21 +2744,22 @@ static int cciss_pci_init(ctlr_info_t *c, struct pci_dev *pdev)
__u64 cfg_offset;
__u32 cfg_base_addr;
__u64 cfg_base_addr_index;
int i;
int i, err;

/* check to see if controller has been disabled */
/* BEFORE trying to enable it */
(void) pci_read_config_word(pdev, PCI_COMMAND,&command);
if(!(command & 0x02))
{
printk(KERN_WARNING "cciss: controller appears to be disabled\n");
return(-1);
return -ENODEV;
}

if (pci_enable_device(pdev))
err = pci_enable_device(pdev);
if (err)
{
printk(KERN_ERR "cciss: Unable to Enable PCI device\n");
return( -1);
return err;
}

subsystem_vendor_id = pdev->subsystem_vendor;
Expand Down Expand Up @@ -2824,7 +2825,8 @@ static int cciss_pci_init(ctlr_info_t *c, struct pci_dev *pdev)
}
if (scratchpad != CCISS_FIRMWARE_READY) {
printk(KERN_WARNING "cciss: Board not ready. Timed out.\n");
return -1;
err = -ENODEV;
goto err_out_disable_pdev;
}

/* get the address index number */
Expand All @@ -2841,7 +2843,8 @@ static int cciss_pci_init(ctlr_info_t *c, struct pci_dev *pdev)
if (cfg_base_addr_index == -1) {
printk(KERN_WARNING "cciss: Cannot find cfg_base_addr_index\n");
release_io_mem(c);
return -1;
err = -ENODEV;
goto err_out_disable_pdev;
}

cfg_offset = readl(c->vaddr + SA5_CTMEM_OFFSET);
Expand All @@ -2868,15 +2871,17 @@ static int cciss_pci_init(ctlr_info_t *c, struct pci_dev *pdev)
printk(KERN_WARNING "cciss: Sorry, I don't know how"
" to access the Smart Array controller %08lx\n",
(unsigned long)board_id);
return -1;
err = -ENODEV;
goto err_out_disable_pdev;
}
if ( (readb(&c->cfgtable->Signature[0]) != 'C') ||
(readb(&c->cfgtable->Signature[1]) != 'I') ||
(readb(&c->cfgtable->Signature[2]) != 'S') ||
(readb(&c->cfgtable->Signature[3]) != 'S') )
{
printk("Does not appear to be a valid CISS config table\n");
return -1;
err = -ENODEV;
goto err_out_disable_pdev;
}

#ifdef CONFIG_X86
Expand Down Expand Up @@ -2920,10 +2925,14 @@ static int cciss_pci_init(ctlr_info_t *c, struct pci_dev *pdev)
{
printk(KERN_WARNING "cciss: unable to get board into"
" simple mode\n");
return -1;
err = -ENODEV;
goto err_out_disable_pdev;
}
return 0;

err_out_disable_pdev:
pci_disable_device(pdev);
return err;
}

/*
Expand Down

0 comments on commit fcab81e

Please sign in to comment.