aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorStephen M. Cameron <scameron@beardog.cce.hp.com>2010-07-19 14:45:36 -0400
committerJens Axboe <jaxboe@fusionio.com>2010-08-07 12:52:11 -0400
commit501b92cd6b394ba56bb978fd55606b5639b4d3fb (patch)
tree47e806135b45b687f64a1ed0e166ed8ba87f101a /drivers
parentafadbf4b9591f3318508792ad98c347336a1a95d (diff)
cciss: factor out CISS_signature_present()
cciss: factor out CISS_signature_present() Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'drivers')
-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 }