Commit 6edf1017 authored by Elad Raz's avatar Elad Raz Committed by David S. Miller
Browse files

devlink: Prevent port_type_set() callback when it's not needed

When a port_type_set() is been called and the new port type set is the same
as the old one, just return success.

Signed-off-by: default avatarElad Raz <>
Signed-off-by: default avatarJiri Pirko <>
Signed-off-by: default avatarDavid S. Miller <>
parent 89ab88b0
......@@ -608,6 +608,8 @@ static int devlink_port_type_set(struct devlink *devlink,
if (devlink->ops && devlink->ops->port_type_set) {
if (port_type == DEVLINK_PORT_TYPE_NOTSET)
return -EINVAL;
if (port_type == devlink_port->type)
return 0;
err = devlink->ops->port_type_set(devlink_port, port_type);
if (err)
return err;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment