Merge tag 'asoc-fix-v5.3-rc3' of https://git.kernel.org/pub/scm/linux/kernel/git...
[platform/kernel/linux-rpi.git] / sound / soc / soc-dapm.c
index 656cb5c..2790c00 100644 (file)
@@ -2156,23 +2156,25 @@ void snd_soc_dapm_debugfs_init(struct snd_soc_dapm_context *dapm,
 {
        struct dentry *d;
 
-       if (!parent)
+       if (!parent || IS_ERR(parent))
                return;
 
        dapm->debugfs_dapm = debugfs_create_dir("dapm", parent);
 
-       if (!dapm->debugfs_dapm) {
+       if (IS_ERR(dapm->debugfs_dapm)) {
                dev_warn(dapm->dev,
-                      "ASoC: Failed to create DAPM debugfs directory\n");
+                        "ASoC: Failed to create DAPM debugfs directory %ld\n",
+                        PTR_ERR(dapm->debugfs_dapm));
                return;
        }
 
        d = debugfs_create_file("bias_level", 0444,
                                dapm->debugfs_dapm, dapm,
                                &dapm_bias_fops);
-       if (!d)
+       if (IS_ERR(d))
                dev_warn(dapm->dev,
-                        "ASoC: Failed to create bias level debugfs file\n");
+                        "ASoC: Failed to create bias level debugfs file: %ld\n",
+                        PTR_ERR(d));
 }
 
 static void dapm_debugfs_add_widget(struct snd_soc_dapm_widget *w)
@@ -2186,10 +2188,10 @@ static void dapm_debugfs_add_widget(struct snd_soc_dapm_widget *w)
        d = debugfs_create_file(w->name, 0444,
                                dapm->debugfs_dapm, w,
                                &dapm_widget_power_fops);
-       if (!d)
+       if (IS_ERR(d))
                dev_warn(w->dapm->dev,
-                       "ASoC: Failed to create %s debugfs file\n",
-                       w->name);
+                        "ASoC: Failed to create %s debugfs file: %ld\n",
+                        w->name, PTR_ERR(d));
 }
 
 static void dapm_debugfs_cleanup(struct snd_soc_dapm_context *dapm)