]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/dax/device.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid
[linux.git] / drivers / dax / device.c
index 8465d12fecba9d3b06c3116ebd7614697becf409..1af823b2fe6bdabea264d17cdbb49670edf61717 100644 (file)
 #include "dax-private.h"
 #include "bus.h"
 
-static struct dev_dax *ref_to_dev_dax(struct percpu_ref *ref)
-{
-       return container_of(ref, struct dev_dax, ref);
-}
-
-static void dev_dax_percpu_release(struct percpu_ref *ref)
-{
-       struct dev_dax *dev_dax = ref_to_dev_dax(ref);
-
-       dev_dbg(&dev_dax->dev, "%s\n", __func__);
-       complete(&dev_dax->cmp);
-}
-
-static void dev_dax_percpu_exit(struct percpu_ref *ref)
-{
-       struct dev_dax *dev_dax = ref_to_dev_dax(ref);
-
-       dev_dbg(&dev_dax->dev, "%s\n", __func__);
-       wait_for_completion(&dev_dax->cmp);
-       percpu_ref_exit(ref);
-}
-
-static void dev_dax_percpu_kill(struct percpu_ref *data)
-{
-       struct percpu_ref *ref = data;
-       struct dev_dax *dev_dax = ref_to_dev_dax(ref);
-
-       dev_dbg(&dev_dax->dev, "%s\n", __func__);
-       percpu_ref_kill(ref);
-}
-
 static int check_vma(struct dev_dax *dev_dax, struct vm_area_struct *vma,
                const char *func)
 {
@@ -459,15 +428,7 @@ int dev_dax_probe(struct device *dev)
                return -EBUSY;
        }
 
-       init_completion(&dev_dax->cmp);
-       rc = percpu_ref_init(&dev_dax->ref, dev_dax_percpu_release, 0,
-                       GFP_KERNEL);
-       if (rc)
-               return rc;
-
-       dev_dax->pgmap.ref = &dev_dax->ref;
-       dev_dax->pgmap.kill = dev_dax_percpu_kill;
-       dev_dax->pgmap.cleanup = dev_dax_percpu_exit;
+       dev_dax->pgmap.type = MEMORY_DEVICE_DEVDAX;
        addr = devm_memremap_pages(dev, &dev_dax->pgmap);
        if (IS_ERR(addr))
                return PTR_ERR(addr);