1ff233cb5SSergey Matyukevich // SPDX-License-Identifier: GPL-2.0+
2ff233cb5SSergey Matyukevich /* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */
398f44cb0SIgor Mitsyanko
498f44cb0SIgor Mitsyanko #include "debug.h"
598f44cb0SIgor Mitsyanko
qtnf_debugfs_init(struct qtnf_bus * bus,const char * name)698f44cb0SIgor Mitsyanko void qtnf_debugfs_init(struct qtnf_bus *bus, const char *name)
798f44cb0SIgor Mitsyanko {
8*0b68fe10SSergey Matyukevich struct dentry *parent = qtnf_get_debugfs_dir();
9*0b68fe10SSergey Matyukevich
10*0b68fe10SSergey Matyukevich bus->dbg_dir = debugfs_create_dir(name, parent);
1198f44cb0SIgor Mitsyanko }
1298f44cb0SIgor Mitsyanko
qtnf_debugfs_remove(struct qtnf_bus * bus)1398f44cb0SIgor Mitsyanko void qtnf_debugfs_remove(struct qtnf_bus *bus)
1498f44cb0SIgor Mitsyanko {
1598f44cb0SIgor Mitsyanko debugfs_remove_recursive(bus->dbg_dir);
1698f44cb0SIgor Mitsyanko bus->dbg_dir = NULL;
1798f44cb0SIgor Mitsyanko }
1898f44cb0SIgor Mitsyanko
qtnf_debugfs_add_entry(struct qtnf_bus * bus,const char * name,int (* fn)(struct seq_file * seq,void * data))1998f44cb0SIgor Mitsyanko void qtnf_debugfs_add_entry(struct qtnf_bus *bus, const char *name,
2098f44cb0SIgor Mitsyanko int (*fn)(struct seq_file *seq, void *data))
2198f44cb0SIgor Mitsyanko {
22b089e694SGreg Kroah-Hartman debugfs_create_devm_seqfile(bus->dev, name, bus->dbg_dir, fn);
2398f44cb0SIgor Mitsyanko }
24