aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen M. Cameron <scameron@beardog.cce.hp.com>2010-05-27 16:13:32 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-07-27 13:01:08 -0400
commit76c46e4970f7ee6d8c54220a767e93d67b74cd33 (patch)
tree9f5840afb6261cc66fbcb0d2510df6034de22973
parentb93d7536eaa1206ad4a00ad8ea700ff0bd75a0da (diff)
[SCSI] hpsa: factor out hpsa-CISS-signature-present
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
-rw-r--r--drivers/scsi/hpsa.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index dcbe54b1dfba..f2a9af64dfaa 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -3372,6 +3372,18 @@ static void __devinit hpsa_find_board_params(struct ctlr_info *h)
3372 } 3372 }
3373} 3373}
3374 3374
3375static inline bool hpsa_CISS_signature_present(struct ctlr_info *h)
3376{
3377 if ((readb(&h->cfgtable->Signature[0]) != 'C') ||
3378 (readb(&h->cfgtable->Signature[1]) != 'I') ||
3379 (readb(&h->cfgtable->Signature[2]) != 'S') ||
3380 (readb(&h->cfgtable->Signature[3]) != 'S')) {
3381 dev_warn(&h->pdev->dev, "not a valid CISS config table\n");
3382 return false;
3383 }
3384 return true;
3385}
3386
3375static int __devinit hpsa_pci_init(struct ctlr_info *h) 3387static int __devinit hpsa_pci_init(struct ctlr_info *h)
3376{ 3388{
3377 int i, prod_index, err; 3389 int i, prod_index, err;
@@ -3415,11 +3427,7 @@ static int __devinit hpsa_pci_init(struct ctlr_info *h)
3415 goto err_out_free_res; 3427 goto err_out_free_res;
3416 hpsa_find_board_params(h); 3428 hpsa_find_board_params(h);
3417 3429
3418 if ((readb(&h->cfgtable->Signature[0]) != 'C') || 3430 if (!hpsa_CISS_signature_present(h)) {
3419 (readb(&h->cfgtable->Signature[1]) != 'I') ||
3420 (readb(&h->cfgtable->Signature[2]) != 'S') ||
3421 (readb(&h->cfgtable->Signature[3]) != 'S')) {
3422 dev_warn(&h->pdev->dev, "not a valid CISS config table\n");
3423 err = -ENODEV; 3431 err = -ENODEV;
3424 goto err_out_free_res; 3432 goto err_out_free_res;
3425 } 3433 }