blob: b8865d70736287ab7b0419cc37fab5179875a59e [file] [log] [blame]
Greg Kroah-Hartman27fb8312014-08-31 13:54:59 -07001/*
2 * Greybus debugfs code
3 *
4 * Copyright 2014 Google Inc.
Alex Eldera46e9672014-12-12 12:08:42 -06005 * Copyright 2014 Linaro Ltd.
Greg Kroah-Hartman27fb8312014-08-31 13:54:59 -07006 *
7 * Released under the GPLv2 only.
8 */
9
10#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
11
Greg Kroah-Hartman27fb8312014-08-31 13:54:59 -070012#include <linux/debugfs.h>
13
14#include "greybus.h"
15
16static struct dentry *gb_debug_root;
17
Greg Kroah-Hartmande536e32014-08-31 16:17:04 -070018int gb_debugfs_init(void)
Greg Kroah-Hartman27fb8312014-08-31 13:54:59 -070019{
20 gb_debug_root = debugfs_create_dir("greybus", NULL);
21 if (!gb_debug_root)
22 return -ENOENT;
23
24 return 0;
25}
26
Greg Kroah-Hartmande536e32014-08-31 16:17:04 -070027void gb_debugfs_cleanup(void)
Greg Kroah-Hartman27fb8312014-08-31 13:54:59 -070028{
29 debugfs_remove_recursive(gb_debug_root);
Viresh Kumarf66832da2014-11-14 17:25:01 +053030 gb_debug_root = NULL;
Greg Kroah-Hartman27fb8312014-08-31 13:54:59 -070031}
Alexandre Bailone8f824b2015-03-18 15:42:51 +010032
33struct dentry *gb_debugfs_get(void)
34{
35 return gb_debug_root;
36}
37EXPORT_SYMBOL_GPL(gb_debugfs_get);