aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound/soc.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/sound/soc.h')
-rw-r--r--include/sound/soc.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h
index e4161071f300..200815ca4112 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -1280,13 +1280,13 @@ int snd_soc_fixup_dai_links_platform_name(struct snd_soc_card *card,
/* set platform name for each dailink */
for_each_card_prelinks(card, i, dai_link) {
+ if (!dai_link->platforms)
+ return -EINVAL;
+
name = devm_kstrdup(card->dev, platform_name, GFP_KERNEL);
if (!name)
return -ENOMEM;
- if (!dai_link->platforms)
- return -EINVAL;
-
/* only single platform is supported for now */
dai_link->platforms->name = name;
}