devlink: Move input checks from driver to devlink

Currently, all the input checks are done in driver.

After adding the split capability to devlink port, move the checks to
devlink.

Signed-off-by: Danielle Ratson <danieller@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Danielle Ratson
2020-07-09 16:18:21 +03:00
committed by David S. Miller
parent a0f49b5486
commit 82901ad169
3 changed files with 23 additions and 19 deletions

View File

@@ -70,9 +70,6 @@ nfp_devlink_port_split(struct devlink *devlink, unsigned int port_index,
unsigned int lanes;
int ret;
if (count < 2)
return -EINVAL;
mutex_lock(&pf->lock);
rtnl_lock();
@@ -81,7 +78,7 @@ nfp_devlink_port_split(struct devlink *devlink, unsigned int port_index,
if (ret)
goto out;
if (eth_port.is_split || eth_port.port_lanes % count) {
if (eth_port.port_lanes % count) {
ret = -EINVAL;
goto out;
}