* [PATCH] firmware: cirrus: cs_dsp: Initialize debugfs_root to invalid
@ 2024-03-07 10:53 Richard Fitzgerald
2024-03-07 14:55 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Richard Fitzgerald @ 2024-03-07 10:53 UTC (permalink / raw)
To: broonie
Cc: linux-sound, alsa-devel, linux-kernel, patches, Richard Fitzgerald
Initialize debugfs_root to -ENODEV so that if the client never sets a
valid debugfs root the debugfs files will not be created.
A NULL pointer passed to any of the debugfs_create_*() functions means
"create in the root of debugfs". It doesn't mean "ignore".
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
---
drivers/firmware/cirrus/cs_dsp.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/firmware/cirrus/cs_dsp.c b/drivers/firmware/cirrus/cs_dsp.c
index 79d4254d1f9b..9f3d665cfdcf 100644
--- a/drivers/firmware/cirrus/cs_dsp.c
+++ b/drivers/firmware/cirrus/cs_dsp.c
@@ -522,7 +522,7 @@ void cs_dsp_cleanup_debugfs(struct cs_dsp *dsp)
{
cs_dsp_debugfs_clear(dsp);
debugfs_remove_recursive(dsp->debugfs_root);
- dsp->debugfs_root = NULL;
+ dsp->debugfs_root = ERR_PTR(-ENODEV);
}
EXPORT_SYMBOL_NS_GPL(cs_dsp_cleanup_debugfs, FW_CS_DSP);
#else
@@ -2246,6 +2246,11 @@ static int cs_dsp_common_init(struct cs_dsp *dsp)
mutex_init(&dsp->pwr_lock);
+#ifdef CONFIG_DEBUG_FS
+ /* Ensure this is invalid if client never provides a debugfs root */
+ dsp->debugfs_root = ERR_PTR(-ENODEV);
+#endif
+
return 0;
}
--
2.30.2
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] firmware: cirrus: cs_dsp: Initialize debugfs_root to invalid
2024-03-07 10:53 [PATCH] firmware: cirrus: cs_dsp: Initialize debugfs_root to invalid Richard Fitzgerald
@ 2024-03-07 14:55 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2024-03-07 14:55 UTC (permalink / raw)
To: Richard Fitzgerald; +Cc: linux-sound, alsa-devel, linux-kernel, patches
On Thu, 07 Mar 2024 10:53:53 +0000, Richard Fitzgerald wrote:
> Initialize debugfs_root to -ENODEV so that if the client never sets a
> valid debugfs root the debugfs files will not be created.
>
> A NULL pointer passed to any of the debugfs_create_*() functions means
> "create in the root of debugfs". It doesn't mean "ignore".
>
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] firmware: cirrus: cs_dsp: Initialize debugfs_root to invalid
commit: 66626b15636b5f5cf3d7f6104799f77462748974
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-03-07 14:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-07 10:53 [PATCH] firmware: cirrus: cs_dsp: Initialize debugfs_root to invalid Richard Fitzgerald
2024-03-07 14:55 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®