From da8f900b525cf77061117a05593515e4dec80bdc Mon Sep 17 00:00:00 2001 From: Huang Jiachai Date: Tue, 11 Feb 2020 15:48:51 +0800 Subject: [PATCH] dma-buf/sw_sync: sw_sync register as misc devices Because the kernel debug fs will removed from android 11, so we move sw_sync to misc devices, as android lib sync has done the compatibility work, so after this commit, the hwc there is no need to update. Signed-off-by: Huang Jiachai Change-Id: I799b66b1ba98c9370893b9554095664010b635df --- drivers/dma-buf/Kconfig | 1 - drivers/dma-buf/sw_sync.c | 12 ++++++++++++ drivers/dma-buf/sync_debug.c | 2 ++ drivers/dma-buf/sync_debug.h | 7 +++++++ 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/drivers/dma-buf/Kconfig b/drivers/dma-buf/Kconfig index 27e6a2dafeaa..364b93e8460a 100644 --- a/drivers/dma-buf/Kconfig +++ b/drivers/dma-buf/Kconfig @@ -21,7 +21,6 @@ config SW_SYNC bool "Sync File Validation Framework" default n depends on SYNC_FILE - depends on DEBUG_FS help A sync object driver that uses a 32bit counter to coordinate synchronization. Useful when there is no hardware primitive backing diff --git a/drivers/dma-buf/sw_sync.c b/drivers/dma-buf/sw_sync.c index 348b3a9170fa..3daa6c76b8dd 100644 --- a/drivers/dma-buf/sw_sync.c +++ b/drivers/dma-buf/sw_sync.c @@ -7,6 +7,8 @@ #include #include +#include +#include #include #include #include @@ -410,3 +412,13 @@ const struct file_operations sw_sync_debugfs_fops = { .unlocked_ioctl = sw_sync_ioctl, .compat_ioctl = compat_ptr_ioctl, }; + +static struct miscdevice sw_sync_dev = { + .minor = MISC_DYNAMIC_MINOR, + .name = "sw_sync", + .fops = &sw_sync_debugfs_fops, +}; + +module_misc_device(sw_sync_dev); + +MODULE_LICENSE("GPL v2"); diff --git a/drivers/dma-buf/sync_debug.c b/drivers/dma-buf/sync_debug.c index 101394f16930..a2f906741ce0 100644 --- a/drivers/dma-buf/sync_debug.c +++ b/drivers/dma-buf/sync_debug.c @@ -8,6 +8,7 @@ #include #include "sync_debug.h" +#ifdef CONFIG_DEBUG_FS static struct dentry *dbgfs; static LIST_HEAD(sync_timeline_list_head); @@ -188,3 +189,4 @@ static __init int sync_debugfs_init(void) return 0; } late_initcall(sync_debugfs_init); +#endif diff --git a/drivers/dma-buf/sync_debug.h b/drivers/dma-buf/sync_debug.h index 6176e52ba2d7..ee84997da6b4 100644 --- a/drivers/dma-buf/sync_debug.h +++ b/drivers/dma-buf/sync_debug.h @@ -62,11 +62,18 @@ struct sync_pt { struct rb_node node; }; +#ifdef CONFIG_DEBUG_FS extern const struct file_operations sw_sync_debugfs_fops; void sync_timeline_debug_add(struct sync_timeline *obj); void sync_timeline_debug_remove(struct sync_timeline *obj); void sync_file_debug_add(struct sync_file *fence); void sync_file_debug_remove(struct sync_file *fence); +#else +static inline void sync_timeline_debug_add(struct sync_timeline *obj) {} +static inline void sync_timeline_debug_remove(struct sync_timeline *obj) {} +static inline void sync_file_debug_add(struct sync_file *fence) {} +static inline void sync_file_debug_remove(struct sync_file *fence) {} +#endif #endif /* _LINUX_SYNC_H */