From: Israel Rukshin Date: Thu, 7 Jan 2021 15:34:13 +0000 (+0200) Subject: nvmet: Use nvmet_is_port_enabled helper for pi_enable X-Git-Tag: accepted/tizen/unified/20230118.172025~7855^2~14^2~21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cc3456226176385aed8aa6ebb021ebb1380a0183;p=platform%2Fkernel%2Flinux-rpi.git nvmet: Use nvmet_is_port_enabled helper for pi_enable Remove code duplication. Signed-off-by: Israel Rukshin Reviewed-by: Max Gurtovoy Signed-off-by: Christoph Hellwig --- diff --git a/drivers/nvme/target/configfs.c b/drivers/nvme/target/configfs.c index c61ffd7..b2021bf 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;