aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-dapm.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r--sound/soc/soc-dapm.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index d0162a4cb7fd..7caf8c7b0ac5 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -87,16 +87,10 @@ module_param(dapm_status, int, 0);
87MODULE_PARM_DESC(dapm_status, "enable DPM sysfs entries"); 87MODULE_PARM_DESC(dapm_status, "enable DPM sysfs entries");
88 88
89/* create a new dapm widget */ 89/* create a new dapm widget */
90static struct snd_soc_dapm_widget *dapm_cnew_widget( 90static inline struct snd_soc_dapm_widget *dapm_cnew_widget(
91 const struct snd_soc_dapm_widget *_widget) 91 const struct snd_soc_dapm_widget *_widget)
92{ 92{
93 struct snd_soc_dapm_widget* widget; 93 return kmemdup(_widget, sizeof(*_widget), GFP_KERNEL);
94 widget = kmalloc(sizeof(struct snd_soc_dapm_widget), GFP_KERNEL);
95 if (!widget)
96 return NULL;
97
98 memcpy(widget, _widget, sizeof(struct snd_soc_dapm_widget));
99 return widget;
100} 94}
101 95
102/* set up initial codec paths */ 96/* set up initial codec paths */