Merge tag 'powerpc-4.6-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc...
[linux-2.6-microblaze.git] / drivers / misc / cxl / sysfs.c
index 907c99b..25913c0 100644 (file)
@@ -392,8 +392,7 @@ static ssize_t afu_eb_read(struct file *filp, struct kobject *kobj,
                               struct bin_attribute *bin_attr, char *buf,
                               loff_t off, size_t count)
 {
-       struct cxl_afu *afu = to_cxl_afu(container_of(kobj,
-                                                     struct device, kobj));
+       struct cxl_afu *afu = to_cxl_afu(kobj_to_dev(kobj));
 
        return cxl_ops->afu_read_err_buffer(afu, buf, off, count);
 }
@@ -488,7 +487,7 @@ static ssize_t afu_read_config(struct file *filp, struct kobject *kobj,
                               loff_t off, size_t count)
 {
        struct afu_config_record *cr = to_cr(kobj);
-       struct cxl_afu *afu = to_cxl_afu(container_of(kobj->parent, struct device, kobj));
+       struct cxl_afu *afu = to_cxl_afu(kobj_to_dev(kobj->parent));
 
        u64 i, j, val, rc;