Merge tag 's390-6.9-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
[linux-2.6-microblaze.git] / drivers / s390 / block / dcssblk.c
index 9c8f529..6d1689a 100644 (file)
@@ -552,6 +552,7 @@ dcssblk_add_store(struct device *dev, struct device_attribute *attr, const char
        int rc, i, j, num_of_segments;
        struct dcssblk_dev_info *dev_info;
        struct segment_info *seg_info, *temp;
+       struct dax_device *dax_dev;
        char *local_buf;
        unsigned long seg_byte_size;
 
@@ -679,13 +680,13 @@ dcssblk_add_store(struct device *dev, struct device_attribute *attr, const char
        if (rc)
                goto put_dev;
 
-       dev_info->dax_dev = alloc_dax(dev_info, &dcssblk_dax_ops);
-       if (IS_ERR(dev_info->dax_dev)) {
-               rc = PTR_ERR(dev_info->dax_dev);
-               dev_info->dax_dev = NULL;
+       dax_dev = alloc_dax(dev_info, &dcssblk_dax_ops);
+       if (IS_ERR(dax_dev)) {
+               rc = PTR_ERR(dax_dev);
                goto put_dev;
        }
-       set_dax_synchronous(dev_info->dax_dev);
+       set_dax_synchronous(dax_dev);
+       dev_info->dax_dev = dax_dev;
        rc = dax_add_host(dev_info->dax_dev, dev_info->gd);
        if (rc)
                goto out_dax;
@@ -919,7 +920,7 @@ __dcssblk_direct_access(struct dcssblk_dev_info *dev_info, pgoff_t pgoff,
 
        dev_sz = dev_info->end - dev_info->start + 1;
        if (kaddr)
-               *kaddr = (void *) dev_info->start + offset;
+               *kaddr = __va(dev_info->start + offset);
        if (pfn)
                *pfn = __pfn_to_pfn_t(PFN_DOWN(dev_info->start + offset),
                                PFN_DEV|PFN_SPECIAL);