diff options
author | Stephen M. Cameron <scameron@beardog.cce.hp.com> | 2010-07-19 20:45:36 +0200 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2010-08-07 18:52:11 +0200 |
commit | 501b92cd6b394ba56bb978fd55606b5639b4d3fb (patch) | |
tree | 47e806135b45b687f64a1ed0e166ed8ba87f101a /drivers/block/cciss.c | |
parent | cciss: factor out cciss_find_board_params (diff) | |
download | linux-501b92cd6b394ba56bb978fd55606b5639b4d3fb.tar.xz linux-501b92cd6b394ba56bb978fd55606b5639b4d3fb.zip |
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/block/cciss.c')
-rw-r--r-- | drivers/block/cciss.c | 18 |
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) } } +static inline bool CISS_signature_present(ctlr_info_t *h) +{ + if ((readb(&h->cfgtable->Signature[0]) != 'C') || + (readb(&h->cfgtable->Signature[1]) != 'I') || + (readb(&h->cfgtable->Signature[2]) != 'S') || + (readb(&h->cfgtable->Signature[3]) != 'S')) { + dev_warn(&h->pdev->dev, "not a valid CISS config table\n"); + return false; + } + return true; +} + static int __devinit cciss_pci_init(ctlr_info_t *c) { int prod_index, err; @@ -4153,11 +4165,7 @@ static int __devinit cciss_pci_init(ctlr_info_t *c) #endif /* CCISS_DEBUG */ cciss_find_board_params(c); - 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"); + if (!CISS_signature_present(c)) { err = -ENODEV; goto err_out_free_res; } |