aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorIsrael Rukshin2021-01-07 17:34:13 +0200
committerChristoph Hellwig2021-02-02 10:26:10 +0100
commitcc3456226176385aed8aa6ebb021ebb1380a0183 (patch)
treee66afd2690bdaadf5140601e57113c682ba90ed6 /drivers
parente8628013e5ddc7cf78cc2f738ab760e8c0fa8559 (diff)
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/nvme/target/configfs.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/nvme/target/configfs.c b/drivers/nvme/target/configfs.c
index c61ffd767062..b2021bf6cee5 100644
--- a/drivers/nvme/target/configfs.c
+++ b/drivers/nvme/target/configfs.c
@@ -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;