summaryrefslogtreecommitdiffstats
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.c48
1 files changed, 21 insertions, 27 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 8ede773b1db8..7e96793050c9 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -1,27 +1,21 @@
-/*
- * soc-dapm.c -- ALSA SoC Dynamic Audio Power Management
- *
- * Copyright 2005 Wolfson Microelectronics PLC.
- * Author: Liam Girdwood <lrg@slimlogic.co.uk>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * Features:
- * o Changes power status of internal codec blocks depending on the
- * dynamic configuration of codec internal audio paths and active
- * DACs/ADCs.
- * o Platform power domain - can support external components i.e. amps and
- * mic/headphone insertion events.
- * o Automatic Mic Bias support
- * o Jack insertion power event initiation - e.g. hp insertion will enable
- * sinks, dacs, etc
- * o Delayed power down of audio subsystem to reduce pops between a quick
- * device reopen.
- *
- */
+// SPDX-License-Identifier: GPL-2.0+
+//
+// soc-dapm.c -- ALSA SoC Dynamic Audio Power Management
+//
+// Copyright 2005 Wolfson Microelectronics PLC.
+// Author: Liam Girdwood <lrg@slimlogic.co.uk>
+//
+// Features:
+// o Changes power status of internal codec blocks depending on the
+// dynamic configuration of codec internal audio paths and active
+// DACs/ADCs.
+// o Platform power domain - can support external components i.e. amps and
+// mic/headphone insertion events.
+// o Automatic Mic Bias support
+// o Jack insertion power event initiation - e.g. hp insertion will enable
+// sinks, dacs, etc
+// o Delayed power down of audio subsystem to reduce pops between a quick
+// device reopen.
#include <linux/module.h>
#include <linux/moduleparam.h>
@@ -1086,7 +1080,7 @@ static int dapm_widget_list_create(struct snd_soc_dapm_widget_list **list,
list_for_each(it, widgets)
size++;
- *list = kzalloc(sizeof(**list) + size * sizeof(*w), GFP_KERNEL);
+ *list = kzalloc(struct_size(*list, widgets, size), GFP_KERNEL);
if (*list == NULL)
return -ENOMEM;
@@ -3055,7 +3049,7 @@ int snd_soc_dapm_new_widgets(struct snd_soc_card *card)
continue;
if (w->num_kcontrols) {
- w->kcontrols = kzalloc(w->num_kcontrols *
+ w->kcontrols = kcalloc(w->num_kcontrols,
sizeof(struct snd_kcontrol *),
GFP_KERNEL);
if (!w->kcontrols) {
@@ -3662,7 +3656,7 @@ static int snd_soc_dai_link_event(struct snd_soc_dapm_widget *w,
struct snd_pcm_substream substream;
struct snd_pcm_hw_params *params = NULL;
struct snd_pcm_runtime *runtime = NULL;
- u64 fmt;
+ unsigned int fmt;
int ret;
if (WARN_ON(!config) ||