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

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
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -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;