Link: https://lore.kernel.org/r/20260217200002.683975158@linuxfoundation.org Tested-by: Florian Fainelli <florian.fainelli@broadcom.com> Tested-by: Takeshi Ogasawara <takeshi.ogasawara@futuring-girl.com> Tested-by: Peter Schneider <pschneider1968@googlemail.com> Tested-by: Jon Hunter <jonathanh@nvidia.com> Tested-by: Salvatore Bonaccorso <carnil@debian.org> Tested-by: Brett A C Sheffield <bacs@librecast.net> Tested-by: Mark Brown <broonie@kernel.org> Tested-by: Luna Jernberg <droidbittin@gmail.com> Tested-by: Ronald Warsow <rwarsow@gmx.de> Tested-by: Justin M. Forbes <jforbes@fedoraproject.org> Tested-by: Ron Economos <re@w6rz.net> Tested-by: Miguel Ojeda <ojeda@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
48 lines
1014 B
C
48 lines
1014 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
/* Copyright (c) 2022, Intel Corporation. */
|
|
|
|
#include <linux/debugfs.h>
|
|
#include "ice.h"
|
|
|
|
static struct dentry *ice_debugfs_root;
|
|
|
|
int ice_debugfs_pf_init(struct ice_pf *pf)
|
|
{
|
|
const char *name = pci_name(pf->pdev);
|
|
|
|
pf->ice_debugfs_pf = debugfs_create_dir(name, ice_debugfs_root);
|
|
if (IS_ERR(pf->ice_debugfs_pf))
|
|
return PTR_ERR(pf->ice_debugfs_pf);
|
|
|
|
return 0;
|
|
}
|
|
|
|
/**
|
|
* ice_debugfs_pf_deinit - cleanup PF's debugfs
|
|
* @pf: pointer to the PF struct
|
|
*/
|
|
void ice_debugfs_pf_deinit(struct ice_pf *pf)
|
|
{
|
|
debugfs_remove_recursive(pf->ice_debugfs_pf);
|
|
pf->ice_debugfs_pf = NULL;
|
|
}
|
|
|
|
/**
|
|
* ice_debugfs_init - create root directory for debugfs entries
|
|
*/
|
|
void ice_debugfs_init(void)
|
|
{
|
|
ice_debugfs_root = debugfs_create_dir(KBUILD_MODNAME, NULL);
|
|
if (IS_ERR(ice_debugfs_root))
|
|
pr_info("init of debugfs failed\n");
|
|
}
|
|
|
|
/**
|
|
* ice_debugfs_exit - remove debugfs entries
|
|
*/
|
|
void ice_debugfs_exit(void)
|
|
{
|
|
debugfs_remove_recursive(ice_debugfs_root);
|
|
ice_debugfs_root = NULL;
|
|
}
|