diff options
author | Leon Romanovsky <leonro@nvidia.com> | 2021-09-22 11:58:03 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-09-22 14:15:12 +0100 |
commit | db4278c55fa53760893266538e86e638330b03bb (patch) | |
tree | c2b028bf752e268e9a85791aa199db4f559b80be /drivers/net/ethernet/marvell/octeontx2/nic/otx2_devlink.c | |
parent | net/ipv4/sysctl_net_ipv4.c: remove superfluous header files from sysctl_net_ipv4.c (diff) | |
download | linux-dev-db4278c55fa53760893266538e86e638330b03bb.tar.xz linux-dev-db4278c55fa53760893266538e86e638330b03bb.zip |
devlink: Make devlink_register to be void
devlink_register() can't fail and always returns success, but all drivers
are obligated to check returned status anyway. This adds a lot of boilerplate
code to handle impossible flow.
Make devlink_register() void and simplify the drivers that use that
API call.
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Acked-by: Simon Horman <simon.horman@corigine.com>
Acked-by: Vladimir Oltean <olteanv@gmail.com> # dsa
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/marvell/octeontx2/nic/otx2_devlink.c')
-rw-r--r-- | drivers/net/ethernet/marvell/octeontx2/nic/otx2_devlink.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_devlink.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_devlink.c index 7ac3ef2fa06a..3de18f9433ae 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_devlink.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_devlink.c @@ -108,13 +108,7 @@ int otx2_register_dl(struct otx2_nic *pfvf) return -ENOMEM; } - err = devlink_register(dl); - if (err) { - dev_err(pfvf->dev, "devlink register failed with error %d\n", err); - devlink_free(dl); - return err; - } - + devlink_register(dl); otx2_dl = devlink_priv(dl); otx2_dl->dl = dl; otx2_dl->pfvf = pfvf; |