nvmet: Use PTR_ERR_OR_ZERO() in nvmet_init_discovery()

Simplify this function implementation by using a known function.

Generated by: scripts/coccinelle/api/ptr_ret.cocci
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
This commit is contained in:
Markus Elfring 2019-09-06 19:50:19 +02:00 committed by Sagi Grimberg
parent 97b3807e93
commit 1179d337be
1 changed files with 1 additions and 3 deletions

View File

@ -381,9 +381,7 @@ int __init nvmet_init_discovery(void)
{
nvmet_disc_subsys =
nvmet_subsys_alloc(NVME_DISC_SUBSYS_NAME, NVME_NQN_DISC);
if (IS_ERR(nvmet_disc_subsys))
return PTR_ERR(nvmet_disc_subsys);
return 0;
return PTR_ERR_OR_ZERO(nvmet_disc_subsys);
}
void nvmet_exit_discovery(void)