Merge drm/drm-fixes into drm-misc-fixes
[sfrench/cifs-2.6.git] / drivers / dma-buf / dma-buf-sysfs-stats.c
index f69d68122b9b1313ebc6f94cfb12d7c707cebe2e..fbf725fae7c1c39480d59c2ce5e610fcf5b1874c 100644 (file)
@@ -168,14 +168,11 @@ void dma_buf_uninit_sysfs_statistics(void)
        kset_unregister(dma_buf_stats_kset);
 }
 
-int dma_buf_stats_setup(struct dma_buf *dmabuf)
+int dma_buf_stats_setup(struct dma_buf *dmabuf, struct file *file)
 {
        struct dma_buf_sysfs_entry *sysfs_entry;
        int ret;
 
-       if (!dmabuf || !dmabuf->file)
-               return -EINVAL;
-
        if (!dmabuf->exp_name) {
                pr_err("exporter name must not be empty if stats needed\n");
                return -EINVAL;
@@ -192,7 +189,7 @@ int dma_buf_stats_setup(struct dma_buf *dmabuf)
 
        /* create the directory for buffer stats */
        ret = kobject_init_and_add(&sysfs_entry->kobj, &dma_buf_ktype, NULL,
-                                  "%lu", file_inode(dmabuf->file)->i_ino);
+                                  "%lu", file_inode(file)->i_ino);
        if (ret)
                goto err_sysfs_dmabuf;