gator-driver: choosing kernel API based on version
authorBernhard Rosenkranzer <bernhard.rosenkranzer@linaro.org>
Mon, 7 May 2012 22:36:14 +0000 (16:36 -0600)
committerMathieu J. Poirier <mathieu.poirier@linaro.org>
Mon, 7 May 2012 22:48:22 +0000 (16:48 -0600)
'd_alloc_root' has been replaced by 'd_make_root' in 3.4 by this
upstream commit: 32991ab vfs: d_alloc_root() gone

This patch selects one function or another based on the kernel
version.

Change-Id: I3efbf4eadb1826f427d2a3eb6f140bc808e32e6a
Signed-off-by: Bernhard Rosenkranzer <bernhard.rosenkranzer@linaro.org>
Committed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
driver/gator_fs.c

index 8277c3aac3eb3fadc58209406d0d19c29f954d47..816dc7d6bd38e08578964669c7a2b9121f290ddd 100644 (file)
@@ -233,7 +233,11 @@ static int gatorfs_fill_super(struct super_block *sb, void *data, int silent)
                return -ENOMEM;
        root_inode->i_op = &simple_dir_inode_operations;
        root_inode->i_fop = &simple_dir_operations;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0)
        root_dentry = d_alloc_root(root_inode);
+#else
+       root_dentry = d_make_root(root_inode);
+#endif
        if (!root_dentry) {
                iput(root_inode);
                return -ENOMEM;