diff options
author | Mathias Krause <minipli@googlemail.com> | 2016-06-19 08:31:31 -0400 |
---|---|---|
committer | Sumit Semwal <sumit.semwal@linaro.org> | 2016-06-20 12:56:37 -0400 |
commit | bd3e22088f41a16b4c362622c91243f9f4fd7dcb (patch) | |
tree | 90433223c06f73c82157b76802ae8774ba1e74b2 | |
parent | b7479990435713b00870df3c1d98ff66f6ef1ba2 (diff) |
dma-buf: remove dma_buf_debugfs_create_file()
There is only a single user of dma_buf_debugfs_create_file() and that
one got the function pointer cast wrong. With that one fixed, there is
no need to have a wrapper for debugfs_create_file(), just call it
directly.
With no users left, we can remove dma_buf_debugfs_create_file().
While at it, simplify the error handling in dma_buf_init_debugfs()
slightly.
Signed-off-by: Mathias Krause <minipli@googlemail.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1466339491-12639-2-git-send-email-minipli@googlemail.com
-rw-r--r-- | drivers/dma-buf/dma-buf.c | 29 | ||||
-rw-r--r-- | include/linux/dma-buf.h | 2 |
2 files changed, 9 insertions, 22 deletions
diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c index f03e51561199..20ce0687b111 100644 --- a/drivers/dma-buf/dma-buf.c +++ b/drivers/dma-buf/dma-buf.c | |||
@@ -895,22 +895,22 @@ static struct dentry *dma_buf_debugfs_dir; | |||
895 | 895 | ||
896 | static int dma_buf_init_debugfs(void) | 896 | static int dma_buf_init_debugfs(void) |
897 | { | 897 | { |
898 | struct dentry *d; | ||
898 | int err = 0; | 899 | int err = 0; |
899 | 900 | ||
900 | dma_buf_debugfs_dir = debugfs_create_dir("dma_buf", NULL); | 901 | d = debugfs_create_dir("dma_buf", NULL); |
902 | if (IS_ERR(d)) | ||
903 | return PTR_ERR(d); | ||
901 | 904 | ||
902 | if (IS_ERR(dma_buf_debugfs_dir)) { | 905 | dma_buf_debugfs_dir = d; |
903 | err = PTR_ERR(dma_buf_debugfs_dir); | ||
904 | dma_buf_debugfs_dir = NULL; | ||
905 | return err; | ||
906 | } | ||
907 | 906 | ||
908 | err = dma_buf_debugfs_create_file("bufinfo", NULL); | 907 | d = debugfs_create_file("bufinfo", S_IRUGO, dma_buf_debugfs_dir, |
909 | 908 | NULL, &dma_buf_debug_fops); | |
910 | if (err) { | 909 | if (IS_ERR(d)) { |
911 | pr_debug("dma_buf: debugfs: failed to create node bufinfo\n"); | 910 | pr_debug("dma_buf: debugfs: failed to create node bufinfo\n"); |
912 | debugfs_remove_recursive(dma_buf_debugfs_dir); | 911 | debugfs_remove_recursive(dma_buf_debugfs_dir); |
913 | dma_buf_debugfs_dir = NULL; | 912 | dma_buf_debugfs_dir = NULL; |
913 | err = PTR_ERR(d); | ||
914 | } | 914 | } |
915 | 915 | ||
916 | return err; | 916 | return err; |
@@ -921,17 +921,6 @@ static void dma_buf_uninit_debugfs(void) | |||
921 | if (dma_buf_debugfs_dir) | 921 | if (dma_buf_debugfs_dir) |
922 | debugfs_remove_recursive(dma_buf_debugfs_dir); | 922 | debugfs_remove_recursive(dma_buf_debugfs_dir); |
923 | } | 923 | } |
924 | |||
925 | int dma_buf_debugfs_create_file(const char *name, | ||
926 | int (*write)(struct seq_file *)) | ||
927 | { | ||
928 | struct dentry *d; | ||
929 | |||
930 | d = debugfs_create_file(name, S_IRUGO, dma_buf_debugfs_dir, | ||
931 | write, &dma_buf_debug_fops); | ||
932 | |||
933 | return PTR_ERR_OR_ZERO(d); | ||
934 | } | ||
935 | #else | 924 | #else |
936 | static inline int dma_buf_init_debugfs(void) | 925 | static inline int dma_buf_init_debugfs(void) |
937 | { | 926 | { |
diff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h index 4551c6f2a6c4..e0b0741ae671 100644 --- a/include/linux/dma-buf.h +++ b/include/linux/dma-buf.h | |||
@@ -242,6 +242,4 @@ int dma_buf_mmap(struct dma_buf *, struct vm_area_struct *, | |||
242 | unsigned long); | 242 | unsigned long); |
243 | void *dma_buf_vmap(struct dma_buf *); | 243 | void *dma_buf_vmap(struct dma_buf *); |
244 | void dma_buf_vunmap(struct dma_buf *, void *vaddr); | 244 | void dma_buf_vunmap(struct dma_buf *, void *vaddr); |
245 | int dma_buf_debugfs_create_file(const char *name, | ||
246 | int (*write)(struct seq_file *)); | ||
247 | #endif /* __DMA_BUF_H__ */ | 245 | #endif /* __DMA_BUF_H__ */ |