}
 static DEVICE_ATTR_RO(holder);
 
-static ssize_t __holder_class_store(struct device *dev, const char *buf)
+static int __holder_class_store(struct device *dev, const char *buf)
 {
        struct nd_namespace_common *ndns = to_ndns(dev);
 
        if (dev->driver || ndns->claim)
                return -EBUSY;
 
-       if (sysfs_streq(buf, "btt"))
-               ndns->claim_class = btt_claim_class(dev);
-       else if (sysfs_streq(buf, "pfn"))
+       if (sysfs_streq(buf, "btt")) {
+               int rc = btt_claim_class(dev);
+
+               if (rc < NVDIMM_CCLASS_NONE)
+                       return rc;
+               ndns->claim_class = rc;
+       } else if (sysfs_streq(buf, "pfn"))
                ndns->claim_class = NVDIMM_CCLASS_PFN;
        else if (sysfs_streq(buf, "dax"))
                ndns->claim_class = NVDIMM_CCLASS_DAX;
        else
                return -EINVAL;
 
-       /* btt_claim_class() could've returned an error */
-       if (ndns->claim_class < 0)
-               return ndns->claim_class;
-
        return 0;
 }
 
                struct device_attribute *attr, const char *buf, size_t len)
 {
        struct nd_region *nd_region = to_nd_region(dev->parent);
-       ssize_t rc;
+       int rc;
 
        nd_device_lock(dev);
        nvdimm_bus_lock(dev);
        rc = __holder_class_store(dev, buf);
        if (rc >= 0)
                rc = nd_namespace_label_update(nd_region, dev);
-       dev_dbg(dev, "%s(%zd)\n", rc < 0 ? "fail " : "", rc);
+       dev_dbg(dev, "%s(%d)\n", rc < 0 ? "fail " : "", rc);
        nvdimm_bus_unlock(dev);
        nd_device_unlock(dev);