Merge remote-tracking branch 'nvdimm/libnvdimm-for-next'
[deliverable/linux.git] / drivers / nvdimm / dimm.c
index 71d12bb67339148bac8edc2e70c907aff1852f5a..619834e144d1e65e2314cde9356c86cff44d5053 100644 (file)
@@ -26,6 +26,14 @@ static int nvdimm_probe(struct device *dev)
        struct nvdimm_drvdata *ndd;
        int rc;
 
+       rc = nvdimm_check_config_data(dev);
+       if (rc) {
+               /* not required for non-aliased nvdimm, ex. NVDIMM-N */
+               if (rc == -ENOTTY)
+                       rc = 0;
+               return rc;
+       }
+
        ndd = kzalloc(sizeof(*ndd), GFP_KERNEL);
        if (!ndd)
                return -ENOMEM;
@@ -72,6 +80,9 @@ static int nvdimm_remove(struct device *dev)
 {
        struct nvdimm_drvdata *ndd = dev_get_drvdata(dev);
 
+       if (!ndd)
+               return 0;
+
        nvdimm_bus_lock(dev);
        dev_set_drvdata(dev, NULL);
        nvdimm_bus_unlock(dev);
This page took 0.023686 seconds and 5 git commands to generate.