aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/cciss.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block/cciss.c')
-rw-r--r--drivers/block/cciss.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 97feb50675cf..9a4869572a0b 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -4096,6 +4096,18 @@ static void __devinit cciss_find_board_params(ctlr_info_t *h)
4096 } 4096 }
4097} 4097}
4098 4098
4099static inline bool CISS_signature_present(ctlr_info_t *h)
4100{
4101 if ((readb(&h->cfgtable->Signature[0]) != 'C') ||
4102 (readb(&h->cfgtable->Signature[1]) != 'I') ||
4103 (readb(&h->cfgtable->Signature[2]) != 'S') ||
4104 (readb(&h->cfgtable->Signature[3]) != 'S')) {
4105 dev_warn(&h->pdev->dev, "not a valid CISS config table\n");
4106 return false;
4107 }
4108 return true;
4109}
4110
4099static int __devinit cciss_pci_init(ctlr_info_t *c) 4111static int __devinit cciss_pci_init(ctlr_info_t *c)
4100{ 4112{
4101 int prod_index, err; 4113 int prod_index, err;
@@ -4153,11 +4165,7 @@ static int __devinit cciss_pci_init(ctlr_info_t *c)
4153#endif /* CCISS_DEBUG */ 4165#endif /* CCISS_DEBUG */
4154 cciss_find_board_params(c); 4166 cciss_find_board_params(c);
4155 4167
4156 if ((readb(&c->cfgtable->Signature[0]) != 'C') || 4168 if (!CISS_signature_present(c)) {
4157 (readb(&c->cfgtable->Signature[1]) != 'I') ||
4158 (readb(&c->cfgtable->Signature[2]) != 'S') ||
4159 (readb(&c->cfgtable->Signature[3]) != 'S')) {
4160 printk("Does not appear to be a valid CISS config table\n");
4161 err = -ENODEV; 4169 err = -ENODEV;
4162 goto err_out_free_res; 4170 goto err_out_free_res;
4163 } 4171 }