diff mbox

[7/9] libnvdimm, pfn: fix nd_pfn_validate() return value handling

Message ID 20151215021505.37090.61896.stgit@dwillia2-desk3.jf.intel.com (mailing list archive)
State Accepted
Commit 3fa962686568
Headers show

Commit Message

Dan Williams Dec. 15, 2015, 2:15 a.m. UTC
The -ENODEV case indicates that the info-block needs to established.
All other return codes cause nd_pfn_init() to abort.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 drivers/nvdimm/pmem.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c
index dc6866734f70..ab689bca727d 100644
--- a/drivers/nvdimm/pmem.c
+++ b/drivers/nvdimm/pmem.c
@@ -238,7 +238,9 @@  static int nd_pfn_init(struct nd_pfn *nd_pfn)
 
 	nd_pfn->pfn_sb = pfn_sb;
 	rc = nd_pfn_validate(nd_pfn);
-	if (rc == 0 || rc == -EBUSY)
+	if (rc == -ENODEV)
+		/* no info block, do init */;
+	else
 		return rc;
 
 	nd_region = to_nd_region(nd_pfn->dev.parent);