Commit cc345622 authored by Israel Rukshin's avatar Israel Rukshin Committed by Christoph Hellwig

nvmet: Use nvmet_is_port_enabled helper for pi_enable

Remove code duplication.
Signed-off-by: default avatarIsrael Rukshin <israelr@nvidia.com>
Reviewed-by: default avatarMax Gurtovoy <mgurtovoy@nvidia.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent e8628013
......@@ -266,10 +266,8 @@ static ssize_t nvmet_param_pi_enable_store(struct config_item *item,
if (strtobool(page, &val))
return -EINVAL;
if (port->enabled) {
pr_err("Disable port before setting pi_enable value.\n");
if (nvmet_is_port_enabled(port, __func__))
return -EACCES;
}
port->pi_enable = val;
return count;
......
Markdown is supported
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