Commit 5b9633af authored by Christian Brauner's avatar Christian Brauner Committed by Greg Kroah-Hartman

binderfs: remove separate device_initcall()

binderfs should not have a separate device_initcall(). When a kernel is
compiled with CONFIG_ANDROID_BINDERFS register the filesystem alongside
CONFIG_ANDROID_IPC. This use-case is especially sensible when users specify
CONFIG_ANDROID_IPC=y, CONFIG_ANDROID_BINDERFS=y and
ANDROID_BINDER_DEVICES="".
When CONFIG_ANDROID_BINDERFS=n then this always succeeds so there's no
regression potential for legacy workloads.
Signed-off-by: default avatarChristian Brauner <christian@brauner.io>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 32a66374
...@@ -5854,9 +5854,10 @@ static int __init init_binder_device(const char *name) ...@@ -5854,9 +5854,10 @@ static int __init init_binder_device(const char *name)
static int __init binder_init(void) static int __init binder_init(void)
{ {
int ret; int ret;
char *device_name, *device_names, *device_tmp; char *device_name, *device_tmp;
struct binder_device *device; struct binder_device *device;
struct hlist_node *tmp; struct hlist_node *tmp;
char *device_names = NULL;
ret = binder_alloc_shrinker_init(); ret = binder_alloc_shrinker_init();
if (ret) if (ret)
...@@ -5917,6 +5918,10 @@ static int __init binder_init(void) ...@@ -5917,6 +5918,10 @@ static int __init binder_init(void)
} }
} }
ret = init_binderfs();
if (ret)
goto err_init_binder_device_failed;
return ret; return ret;
err_init_binder_device_failed: err_init_binder_device_failed:
......
...@@ -46,4 +46,13 @@ static inline bool is_binderfs_device(const struct inode *inode) ...@@ -46,4 +46,13 @@ static inline bool is_binderfs_device(const struct inode *inode)
} }
#endif #endif
#ifdef CONFIG_ANDROID_BINDERFS
extern int __init init_binderfs(void);
#else
static inline int __init init_binderfs(void)
{
return 0;
}
#endif
#endif /* _LINUX_BINDER_INTERNAL_H */ #endif /* _LINUX_BINDER_INTERNAL_H */
...@@ -550,7 +550,7 @@ static struct file_system_type binder_fs_type = { ...@@ -550,7 +550,7 @@ static struct file_system_type binder_fs_type = {
.fs_flags = FS_USERNS_MOUNT, .fs_flags = FS_USERNS_MOUNT,
}; };
static int __init init_binderfs(void) int __init init_binderfs(void)
{ {
int ret; int ret;
...@@ -568,5 +568,3 @@ static int __init init_binderfs(void) ...@@ -568,5 +568,3 @@ static int __init init_binderfs(void)
return ret; return ret;
} }
device_initcall(init_binderfs);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment