blob: e102d7badb9d90f0581067f334d64c986d72e54f [file] [log] [blame]
Greg Kroah-Hartmaneb50fd32017-11-07 14:58:41 +01001// SPDX-License-Identifier: GPL-2.0
Greg Kroah-Hartman27fb8312014-08-31 13:54:59 -07002/*
3 * Greybus debugfs code
4 *
5 * Copyright 2014 Google Inc.
Alex Eldera46e9672014-12-12 12:08:42 -06006 * Copyright 2014 Linaro Ltd.
Greg Kroah-Hartman27fb8312014-08-31 13:54:59 -07007 */
8
Greg Kroah-Hartman27fb8312014-08-31 13:54:59 -07009#include <linux/debugfs.h>
Greg Kroah-Hartmanec0ad862019-08-25 07:54:27 +020010#include <linux/greybus.h>
Greg Kroah-Hartman27fb8312014-08-31 13:54:59 -070011
12static struct dentry *gb_debug_root;
13
Alex Elder47ed2c92015-06-09 17:42:50 -050014void __init gb_debugfs_init(void)
Greg Kroah-Hartman27fb8312014-08-31 13:54:59 -070015{
16 gb_debug_root = debugfs_create_dir("greybus", NULL);
Greg Kroah-Hartman27fb8312014-08-31 13:54:59 -070017}
18
Greg Kroah-Hartmande536e32014-08-31 16:17:04 -070019void gb_debugfs_cleanup(void)
Greg Kroah-Hartman27fb8312014-08-31 13:54:59 -070020{
21 debugfs_remove_recursive(gb_debug_root);
Viresh Kumarf66832d2014-11-14 17:25:01 +053022 gb_debug_root = NULL;
Greg Kroah-Hartman27fb8312014-08-31 13:54:59 -070023}
Alexandre Bailone8f824b2015-03-18 15:42:51 +010024
25struct dentry *gb_debugfs_get(void)
26{
27 return gb_debug_root;
28}
29EXPORT_SYMBOL_GPL(gb_debugfs_get);