nvmet: Use nvmet_is_port_enabled helper for pi_enable
Remove code duplication. Signed-off-by: Israel Rukshin <israelr@nvidia.com> Reviewed-by: Max Gurtovoy <mgurtovoy@nvidia.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
parent
e8628013e5
commit
cc34562261
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue