]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/dax/pmem.c
Merge tag 'libnvdimm-for-4.12' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdim...
[karo-tx-linux.git] / drivers / dax / pmem.c
index 033f49b31fdcfeeedede6a6349bbdab5115c82f6..9f2a0b4fd8012c05b79a561ee4c2711e64c17fa5 100644 (file)
@@ -16,7 +16,7 @@
 #include <linux/pfn_t.h>
 #include "../nvdimm/pfn.h"
 #include "../nvdimm/nd.h"
-#include "dax.h"
+#include "device-dax.h"
 
 struct dax_pmem {
        struct device *dev;
@@ -43,6 +43,7 @@ static void dax_pmem_percpu_exit(void *data)
        struct dax_pmem *dax_pmem = to_dax_pmem(ref);
 
        dev_dbg(dax_pmem->dev, "%s\n", __func__);
+       wait_for_completion(&dax_pmem->cmp);
        percpu_ref_exit(ref);
 }
 
@@ -53,7 +54,6 @@ static void dax_pmem_percpu_kill(void *data)
 
        dev_dbg(dax_pmem->dev, "%s\n", __func__);
        percpu_ref_kill(ref);
-       wait_for_completion(&dax_pmem->cmp);
 }
 
 static int dax_pmem_probe(struct device *dev)
@@ -61,8 +61,8 @@ static int dax_pmem_probe(struct device *dev)
        int rc;
        void *addr;
        struct resource res;
-       struct dax_dev *dax_dev;
        struct nd_pfn_sb *pfn_sb;
+       struct dev_dax *dev_dax;
        struct dax_pmem *dax_pmem;
        struct nd_region *nd_region;
        struct nd_namespace_io *nsio;
@@ -130,12 +130,12 @@ static int dax_pmem_probe(struct device *dev)
                return -ENOMEM;
 
        /* TODO: support for subdividing a dax region... */
-       dax_dev = devm_create_dax_dev(dax_region, &res, 1);
+       dev_dax = devm_create_dev_dax(dax_region, &res, 1);
 
-       /* child dax_dev instances now own the lifetime of the dax_region */
+       /* child dev_dax instances now own the lifetime of the dax_region */
        dax_region_put(dax_region);
 
-       return PTR_ERR_OR_ZERO(dax_dev);
+       return PTR_ERR_OR_ZERO(dev_dax);
 }
 
 static struct nd_device_driver dax_pmem_driver = {