aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/soc/soc-dapm.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index ffcda7ecd832..8e26c2bc7fdf 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -2194,6 +2194,27 @@ static int snd_soc_dapm_add_path(struct snd_soc_dapm_context *dapm,
2194 struct snd_soc_dapm_path *path; 2194 struct snd_soc_dapm_path *path;
2195 int ret; 2195 int ret;
2196 2196
2197 if (wsink->is_supply && !wsource->is_supply) {
2198 dev_err(dapm->dev,
2199 "Connecting non-supply widget to supply widget is not supported (%s -> %s)\n",
2200 wsource->name, wsink->name);
2201 return -EINVAL;
2202 }
2203
2204 if (connected && !wsource->is_supply) {
2205 dev_err(dapm->dev,
2206 "connected() callback only supported for supply widgets (%s -> %s)\n",
2207 wsource->name, wsink->name);
2208 return -EINVAL;
2209 }
2210
2211 if (wsource->is_supply && control) {
2212 dev_err(dapm->dev,
2213 "Conditional paths are not supported for supply widgets (%s -> [%s] -> %s)\n",
2214 wsource->name, control, wsink->name);
2215 return -EINVAL;
2216 }
2217
2197 path = kzalloc(sizeof(struct snd_soc_dapm_path), GFP_KERNEL); 2218 path = kzalloc(sizeof(struct snd_soc_dapm_path), GFP_KERNEL);
2198 if (!path) 2219 if (!path)
2199 return -ENOMEM; 2220 return -ENOMEM;