]> Pileus Git - ~andy/linux/blobdiff - sound/soc/soc-dapm.c
Merge branch 'linus' of master.kernel.org:/pub/scm/linux/kernel/git/perex/alsa
[~andy/linux] / sound / soc / soc-dapm.c
index d0162a4cb7fd2df95c8c163fd54ecbb84dfd8185..96bce55572a040ce05d665af500b8aa800dc3c04 100644 (file)
@@ -87,16 +87,10 @@ module_param(dapm_status, int, 0);
 MODULE_PARM_DESC(dapm_status, "enable DPM sysfs entries");
 
 /* create a new dapm widget */
-static struct snd_soc_dapm_widget *dapm_cnew_widget(
+static inline struct snd_soc_dapm_widget *dapm_cnew_widget(
        const struct snd_soc_dapm_widget *_widget)
 {
-       struct snd_soc_dapm_widget* widget;
-       widget = kmalloc(sizeof(struct snd_soc_dapm_widget), GFP_KERNEL);
-       if (!widget)
-               return NULL;
-
-       memcpy(widget, _widget, sizeof(struct snd_soc_dapm_widget));
-       return widget;
+       return kmemdup(_widget, sizeof(*_widget), GFP_KERNEL);
 }
 
 /* set up initial codec paths */
@@ -888,13 +882,15 @@ int snd_soc_dapm_connect_input(struct snd_soc_codec *codec, const char *sink,
        if (wsink->id == snd_soc_dapm_input) {
                if (wsource->id == snd_soc_dapm_micbias ||
                        wsource->id == snd_soc_dapm_mic ||
-                       wsink->id == snd_soc_dapm_line)
+                       wsink->id == snd_soc_dapm_line ||
+                       wsink->id == snd_soc_dapm_output)
                        wsink->ext = 1;
        }
        if (wsource->id == snd_soc_dapm_output) {
                if (wsink->id == snd_soc_dapm_spk ||
                        wsink->id == snd_soc_dapm_hp ||
-                       wsink->id == snd_soc_dapm_line)
+                       wsink->id == snd_soc_dapm_line ||
+                       wsink->id == snd_soc_dapm_input)
                        wsource->ext = 1;
        }