summaryrefslogtreecommitdiffstats
path: root/sound/soc/sof/debug.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-09-17 17:43:33 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2019-09-17 17:43:33 -0700
commit6ab8ad31601f29470eb895fd95e5c963e125aa1b (patch)
tree73327fe9fc2ee62e7815fa0a666fdf46aaab7322 /sound/soc/sof/debug.c
parentea982ba7f79141d86eb7a440fcba6796ed718b9b (diff)
parent9bf9bf5440b99edfba496388c90b52ebcd9df715 (diff)
downloadlinux-6ab8ad31601f29470eb895fd95e5c963e125aa1b.tar.bz2
Merge tag 'sound-5.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound updates from Takashi Iwai: "As shown in diffstat and logs, it was again a busy development cycle at this time, too. The most significant changes are still on-going refactoring / modernization works for ASoC core and drivers, but there are lots of other changes as well. Here we go, some highlights below: ASoC: - Quite a lot of cleanup / refactoring of ASoC core and APIs; most of them are systematic, but also including cleanups and modernization - A bulk of updates for some ASoC platforms, Freescale, sunxi and Intel SST/SOF - Initial support for Sound Open Firmware on i.MX8 - Removal of deprecated w90x900 and nuc900 drivers - New support for Cirrus Logic CS47L15 and CS47L92, Freescale i.MX 7ULP and 8MQ, Meson G12A and NXP UDA1334 USB-audio: - More validations of descriptor units for hardening against bugs reported by fuzzers - PCM device assignment workaround for a past call-order change - Scarlett Gen2 mixer interface, a few more more quirks HD-audio: - Support for audio component with AMD/ATI and Nvidia HDMI codecs - Clean up HD-audio core and remove indirect access ops for Intel SOF - DMIC detection at probe; it would make systems automatically falling back to SST/SOF driver on devices that need DMIC handling. Needs a new Kconfig to set, and beware that it's still new and a bit experimental FireWire: - Lots of code refactoring and cleanups" * tag 'sound-5.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (521 commits) ASoC: sdm845: remove unneeded semicolon ASoC: fsl_sai: Implement set_bclk_ratio ASoC: dmaengine: Replace strncpy() with strscpy_pad() for pcm->name ASoC: wcd9335: remove redundant use of ret variable ALSA: firewire-tascam: check intermediate state of clock status and retry ALSA: firewire-tascam: handle error code when getting current source of clock ASoC: hdmi-codec: Add an op to set callback function for plug event ASoC: rt5677: keep analog power register at SND_SOC_BIAS_OFF ASoC: rt5677: Remove magic number register writes ASoC: soc-core: self contained soc_unbind_aux_dev() ASoC: soc-core: add soc_unbind_aux_dev() ASoC: soc-core: self contained soc_bind_aux_dev() ASoC: soc-core: move soc_probe_link_dais() next to soc_remove_link_dais() ASoC: soc-core: self contained soc_probe_link_dais() ASoC: soc-core: add new soc_link_init() ASoC: soc-core: move soc_probe_dai() next to soc_remove_dai() ASoC: soc-core: self contained soc_remove_link_dais() ASoC: soc-core: self contained soc_remove_link_components() ASoC: soc-core: self contained soc_probe_link_components() ASoC: rt1308: make array pd static const, makes object smaller ...
Diffstat (limited to 'sound/soc/sof/debug.c')
-rw-r--r--sound/soc/sof/debug.c50
1 files changed, 19 insertions, 31 deletions
diff --git a/sound/soc/sof/debug.c b/sound/soc/sof/debug.c
index 2388477a965e..54cd431faab7 100644
--- a/sound/soc/sof/debug.c
+++ b/sound/soc/sof/debug.c
@@ -128,6 +128,7 @@ static ssize_t sof_dfsentry_write(struct file *file, const char __user *buffer,
unsigned long ipc_duration_ms = 0;
bool flood_duration_test = false;
unsigned long ipc_count = 0;
+ struct dentry *dentry;
int err;
#endif
size_t size;
@@ -149,11 +150,12 @@ static ssize_t sof_dfsentry_write(struct file *file, const char __user *buffer,
* ipc_duration_ms test floods the DSP for the time specified
* in the debugfs entry.
*/
- if (strcmp(dfse->dfsentry->d_name.name, "ipc_flood_count") &&
- strcmp(dfse->dfsentry->d_name.name, "ipc_flood_duration_ms"))
+ dentry = file->f_path.dentry;
+ if (strcmp(dentry->d_name.name, "ipc_flood_count") &&
+ strcmp(dentry->d_name.name, "ipc_flood_duration_ms"))
return -EINVAL;
- if (!strcmp(dfse->dfsentry->d_name.name, "ipc_flood_duration_ms"))
+ if (!strcmp(dentry->d_name.name, "ipc_flood_duration_ms"))
flood_duration_test = true;
/* test completion criterion */
@@ -226,8 +228,11 @@ static ssize_t sof_dfsentry_read(struct file *file, char __user *buffer,
u8 *buf;
#if IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG_IPC_FLOOD_TEST)
- if ((!strcmp(dfse->dfsentry->d_name.name, "ipc_flood_count") ||
- !strcmp(dfse->dfsentry->d_name.name, "ipc_flood_duration_ms")) &&
+ struct dentry *dentry;
+
+ dentry = file->f_path.dentry;
+ if ((!strcmp(dentry->d_name.name, "ipc_flood_count") ||
+ !strcmp(dentry->d_name.name, "ipc_flood_duration_ms")) &&
dfse->cache_buf) {
if (*ppos)
return 0;
@@ -290,8 +295,7 @@ static ssize_t sof_dfsentry_read(struct file *file, char __user *buffer,
if (!pm_runtime_active(sdev->dev) &&
dfse->access_type == SOF_DEBUGFS_ACCESS_D0_ONLY) {
dev_err(sdev->dev,
- "error: debugfs entry %s cannot be read in DSP D3\n",
- dfse->dfsentry->d_name.name);
+ "error: debugfs entry cannot be read in DSP D3\n");
kfree(buf);
return -EINVAL;
}
@@ -356,17 +360,11 @@ int snd_sof_debugfs_io_item(struct snd_sof_dev *sdev,
}
#endif
- dfse->dfsentry = debugfs_create_file(name, 0444, sdev->debugfs_root,
- dfse, &sof_dfs_fops);
- if (!dfse->dfsentry) {
- /* can't rely on debugfs, only log error and keep going */
- dev_err(sdev->dev, "error: cannot create debugfs entry %s\n",
- name);
- } else {
- /* add to dfsentry list */
- list_add(&dfse->list, &sdev->dfsentry_list);
+ debugfs_create_file(name, 0444, sdev->debugfs_root, dfse,
+ &sof_dfs_fops);
- }
+ /* add to dfsentry list */
+ list_add(&dfse->list, &sdev->dfsentry_list);
return 0;
}
@@ -402,16 +400,10 @@ int snd_sof_debugfs_buf_item(struct snd_sof_dev *sdev,
return -ENOMEM;
#endif
- dfse->dfsentry = debugfs_create_file(name, mode, sdev->debugfs_root,
- dfse, &sof_dfs_fops);
- if (!dfse->dfsentry) {
- /* can't rely on debugfs, only log error and keep going */
- dev_err(sdev->dev, "error: cannot create debugfs entry %s\n",
- name);
- } else {
- /* add to dfsentry list */
- list_add(&dfse->list, &sdev->dfsentry_list);
- }
+ debugfs_create_file(name, mode, sdev->debugfs_root, dfse,
+ &sof_dfs_fops);
+ /* add to dfsentry list */
+ list_add(&dfse->list, &sdev->dfsentry_list);
return 0;
}
@@ -426,10 +418,6 @@ int snd_sof_dbg_init(struct snd_sof_dev *sdev)
/* use "sof" as top level debugFS dir */
sdev->debugfs_root = debugfs_create_dir("sof", NULL);
- if (IS_ERR_OR_NULL(sdev->debugfs_root)) {
- dev_err(sdev->dev, "error: failed to create debugfs directory\n");
- return 0;
- }
/* init dfsentry list */
INIT_LIST_HEAD(&sdev->dfsentry_list);