diff options
author | Saeed Mahameed <saeedm@mellanox.com> | 2016-07-19 20:17:12 +0300 |
---|---|---|
committer | Leon Romanovsky <leon@kernel.org> | 2016-08-17 17:45:58 +0300 |
commit | c4f287c4a6ac489c18afc4acc4353141a8c53070 (patch) | |
tree | 6aff24f9f528f9fa92fc1296fc2e7e664c3068d2 /drivers/net/ethernet/mellanox/mlx5/core/uar.c | |
parent | 1a412fb1caa2c1b77719ccb5ed8b0c3c2bc65da7 (diff) |
net/mlx5: Unify and improve command interface
Now as all commands use mlx5 ifc interface, instead of doing two calls
for executing a command we embed command status checking into
mlx5_cmd_exec to simplify the interface.
Also we do here some cleanup for redundant software structures
(inbox/outbox) and functions and improved command failure output.
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core/uar.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/uar.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/uar.c b/drivers/net/ethernet/mellanox/mlx5/core/uar.c index d0a0e0bc77e4..ab0b896621a0 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/uar.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/uar.c @@ -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); |