net/mlx5: Unify and improve command interface
[linux-2.6-block.git] / drivers / net / ethernet / mellanox / mlx5 / core / uar.c
index d0a0e0bc77e48d5a4fadb7be923bb885e3dad7c8..ab0b896621a0452badce6fcab41dd07d1f9cf7d3 100644 (file)
@@ -50,11 +50,8 @@ int mlx5_cmd_alloc_uar(struct mlx5_core_dev *dev, u32 *uarn)
 
        MLX5_SET(alloc_uar_in, in, opcode, MLX5_CMD_OP_ALLOC_UAR);
        err = mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out));
-       err = err ? : mlx5_cmd_status_to_err_v2(out);
-       if (err)
-               return err;
-
-       *uarn = MLX5_GET(alloc_uar_out, out, uar);
+       if (!err)
+               *uarn = MLX5_GET(alloc_uar_out, out, uar);
        return err;
 }
 EXPORT_SYMBOL(mlx5_cmd_alloc_uar);
@@ -63,12 +60,10 @@ int mlx5_cmd_free_uar(struct mlx5_core_dev *dev, u32 uarn)
 {
        u32 out[MLX5_ST_SZ_DW(dealloc_uar_out)] = {0};
        u32 in[MLX5_ST_SZ_DW(dealloc_uar_in)]   = {0};
-       int err;
 
        MLX5_SET(dealloc_uar_in, in, opcode, MLX5_CMD_OP_DEALLOC_UAR);
        MLX5_SET(dealloc_uar_in, in, uar, uarn);
-       err = mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out));
-       return err ? : mlx5_cmd_status_to_err_v2(out);
+       return mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out));
 }
 EXPORT_SYMBOL(mlx5_cmd_free_uar);