]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
IB/ehca: Return proper error code if register_mr fails
authorHoang-Nam Nguyen <hnguyen@linux.vnet.ibm.com>
Wed, 16 May 2007 12:50:55 +0000 (14:50 +0200)
committerRoland Dreier <rolandd@cisco.com>
Sat, 19 May 2007 15:51:54 +0000 (08:51 -0700)
Set the return code of ehca_register_mr() to ENOMEM if the corresponding
firmware call fails due to out of resources.  Some other error codes
were explicitly mapped to EINVAL -- just remove those cases so they
get mapped to the default case, which already returns EINVAL anyway.

Signed-off-by: Hoang-Nam Nguyen <hnguyen@de.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/hw/ehca/ehca_mrmw.c

index 84c5bb4985634a47f0e2bec5cf8b54038f32c95d..add79bd44e398b0ef82fa7f193f27470ccf92714 100644 (file)
@@ -2050,13 +2050,10 @@ int ehca_mrmw_map_hrc_alloc(const u64 hipz_rc)
        switch (hipz_rc) {
        case H_SUCCESS:              /* successful completion */
                return 0;
-       case H_ADAPTER_PARM:         /* invalid adapter handle */
-       case H_RT_PARM:              /* invalid resource type */
        case H_NOT_ENOUGH_RESOURCES: /* insufficient resources */
-       case H_MLENGTH_PARM:         /* invalid memory length */
-       case H_MEM_ACCESS_PARM:      /* invalid access controls */
        case H_CONSTRAINED:          /* resource constraint */
-               return -EINVAL;
+       case H_NO_MEM:
+               return -ENOMEM;
        case H_BUSY:                 /* long busy */
                return -EBUSY;
        default: