[SCSI] bfa: use negative error return values in all functions
authorKrishna Gudipati <kgudipat@brocade.com>
Wed, 20 Jul 2011 23:59:44 +0000 (16:59 -0700)
committerJames Bottomley <JBottomley@Parallels.com>
Wed, 27 Jul 2011 10:44:06 +0000 (14:44 +0400)
Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/bfa/bfad_bsg.c

index 88bfa92af7406b597d861b3b0eba4a798ee330f5..3601508900b3198111cbd0bc0f9808d965b35926 100644 (file)
@@ -56,7 +56,7 @@ bfad_iocmd_ioc_disable(struct bfad_s *bfad, void *cmd)
        spin_lock_irqsave(&bfad->bfad_lock, flags);
        if (bfad->disable_active) {
                spin_unlock_irqrestore(&bfad->bfad_lock, flags);
-               return EBUSY;
+               return -EBUSY;
        }
 
        bfad->disable_active = BFA_TRUE;
@@ -390,7 +390,7 @@ bfad_iocmd_lport_get_rports(struct bfad_s *bfad, void *cmd,
        void    *iocmd_bufptr;
 
        if (iocmd->nrports == 0)
-               return EINVAL;
+               return -EINVAL;
 
        if (bfad_chk_iocmd_sz(payload_len,
                        sizeof(struct bfa_bsg_lport_get_rports_s),
@@ -1516,7 +1516,7 @@ static int
 bfad_iocmd_handler(struct bfad_s *bfad, unsigned int cmd, void *iocmd,
                unsigned int payload_len)
 {
-       int rc = EINVAL;
+       int rc = -EINVAL;
 
        switch (cmd) {
        case IOCMD_IOC_ENABLE:
@@ -1704,10 +1704,10 @@ bfad_iocmd_handler(struct bfad_s *bfad, unsigned int cmd, void *iocmd,
                rc = bfad_iocmd_porglog_get(bfad, iocmd);
                break;
        default:
-               rc = EINVAL;
+               rc = -EINVAL;
                break;
        }
-       return -rc;
+       return rc;
 }
 
 static int