soc: ti: knav_qmss: Remove debugfs file on teardown

knav_queue_probe() creates the global qmss debugfs file whose show
callback reads the global knav_qdev state. knav_queue_remove() tears
down the queue manager resources but leaves the debugfs file published.

Save the debugfs dentry in struct knav_device and remove it during
teardown before the resources used by the show callback are released.
While touching the debugfs_create_file() call, spell the unchanged read-
only file mode as 0444.

Fixes: 41f93af900 ("soc: ti: add Keystone Navigator QMSS driver")
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Link: https://patch.msgid.link/20260706144706.96313-1-pengpeng@iscas.ac.cn
Signed-off-by: Nishanth Menon <nm@ti.com>
This commit is contained in:
Pengpeng Hou 2026-07-06 22:47:06 +08:00 committed by Nishanth Menon
parent f52ddaf5e7
commit 3c81786275
2 changed files with 6 additions and 2 deletions

View File

@ -304,6 +304,7 @@ struct knav_device {
struct list_head pools;
struct list_head pdsps;
struct list_head qmgrs;
struct dentry *debugfs_file;
enum qmss_version version;
};

View File

@ -1849,8 +1849,9 @@ static int knav_queue_probe(struct platform_device *pdev)
goto err;
}
debugfs_create_file("qmss", S_IFREG | S_IRUGO, NULL, NULL,
&knav_queue_debug_fops);
knav_qdev->debugfs_file =
debugfs_create_file("qmss", 0444, NULL, NULL,
&knav_queue_debug_fops);
device_ready = true;
return 0;
@ -1868,6 +1869,8 @@ static void knav_queue_remove(struct platform_device *pdev)
struct knav_device *kdev = platform_get_drvdata(pdev);
device_ready = false;
debugfs_remove(kdev->debugfs_file);
kdev->debugfs_file = NULL;
knav_queue_stop_pdsps(kdev);
knav_queue_free_regions(kdev);
knav_free_queue_ranges(kdev);