]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - sound/soc/soc-dapm.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/joern/misc
[karo-tx-linux.git] / sound / soc / soc-dapm.c
index 411651dc9d1d47b0c7a8a9f1e4f664e3f3451108..7caf8c7b0ac5063c14a20784011de0951047e5c9 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 */
@@ -651,7 +645,6 @@ static void dbg_dump_dapm(struct snd_soc_codec* codec, const char *action)
                                                        p->source->name);
                                }
                                list_for_each_entry(p, &w->sinks, list_source) {
-                                       p = list_entry(lp, struct snd_soc_dapm_path, list_source);
                                        if (p->connect)
                                                printk(" out %s %s\n", p->name ? p->name : "static",
                                                        p->sink->name);
@@ -1240,6 +1233,9 @@ int snd_soc_dapm_stream_event(struct snd_soc_codec *codec,
 {
        struct snd_soc_dapm_widget *w;
 
+       if (stream == NULL)
+               return 0;
+
        mutex_lock(&codec->mutex);
        list_for_each_entry(w, &codec->dapm_widgets, list)
        {