summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/audio-iio-aux.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2023-11-03 01:34:14 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2023-11-03 01:34:14 +0100
commitedd8e84ae9514e93368f56c3715b11af52df6c3b (patch)
tree2b37c874c009ccef2e38157c2fc6040324902673 /sound/soc/codecs/audio-iio-aux.c
parentMerge tag 'for-linus-2023110101' of git://git.kernel.org/pub/scm/linux/kernel... (diff)
parentALSA: hda: cs35l41: Fix missing error code in cs35l41_smart_amp() (diff)
downloadlinux-edd8e84ae9514e93368f56c3715b11af52df6c3b.tar.xz
linux-edd8e84ae9514e93368f56c3715b11af52df6c3b.zip
Merge tag 'sound-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound updates from Takashi Iwai: "Most of changes at this time are for ASoC, spread over ASoC core and drivers due to the API prefix standardization. Other than that, there have little change wrt API, rather lots of driver-specific updates and fixes. Some highlight below: ASoC: - Standardization of API prefix - GPIO API usage improvements - Support for HDA patches - Lots of work on SOF, including crash dump support - Fixes for noise when stopping some Sounwire CODECs - Support for AMD platforms with es83xx, AMD ACP 6.3 and 7.0, Awinc AT87390 and AW88399, many Intel platforms, many Mediatek platforms, Qualcomm SM6115 and SC7180 platforms, Richtek RTQ9128 and Texas Instruments TAS575x HD-audio and USB-audio: - Deferred probe support of audio component binding - More fixes and enhancements for Cirrus subcodecs - USB Scarlett2 mixer and McIntosh DSD quirk Others: - More enhancement of snd-aloop driver - Update MAINTAINERS entry for linux-sound mailing list" * tag 'sound-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (485 commits) ALSA: hda: cs35l41: Fix missing error code in cs35l41_smart_amp() ALSA: hda: cs35l41: mark cs35l41_verify_id() static ASoC: codecs: wsa883x: make use of new mute_unmute_on_trigger flag ASoC: soc-dai: add flag to mute and unmute stream during trigger ASoC: ams-delta.c: use component after check ASoC: amd: acp: select SND_SOC_AMD_ACP_LEGACY_COMMON for ACP63 ASoC: codecs: aw88399: fix typo in Kconfig select ASoC: amd: acp: add ACPI dependency ASoC: Intel: avs: Add rt5514 machine board ASoC: Intel: avs: Add rt5514 machine board ALSA: scarlett2: Add missing check with firmware version control ALSA: virtio: use ack callback ALSA: scarlett2: Remap Level Meter values ALSA: scarlett2: Allow passing any output to line_out_remap() ALSA: scarlett2: Add support for reading firmware version ALSA: scarlett2: Rename Gen 3 config sets ALSA: scarlett2: Rename scarlett_gen2 to scarlett2 ASoC: cs35l41: Detect CSPL errors when sending CSPL commands ALSA: hda: cs35l41: Check CSPL state after loading firmware ALSA: hda: cs35l41: Do not unload firmware before reset in system suspend ...
Diffstat (limited to 'sound/soc/codecs/audio-iio-aux.c')
-rw-r--r--sound/soc/codecs/audio-iio-aux.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/sound/soc/codecs/audio-iio-aux.c b/sound/soc/codecs/audio-iio-aux.c
index a8bf14239bd7..1e8e1effc2af 100644
--- a/sound/soc/codecs/audio-iio-aux.c
+++ b/sound/soc/codecs/audio-iio-aux.c
@@ -26,8 +26,8 @@ struct audio_iio_aux_chan {
struct audio_iio_aux {
struct device *dev;
- struct audio_iio_aux_chan *chans;
unsigned int num_chans;
+ struct audio_iio_aux_chan chans[] __counted_by(num_chans);
};
static int audio_iio_aux_info_volsw(struct snd_kcontrol *kcontrol,
@@ -250,23 +250,18 @@ static int audio_iio_aux_probe(struct platform_device *pdev)
int ret;
int i;
- iio_aux = devm_kzalloc(dev, sizeof(*iio_aux), GFP_KERNEL);
+ count = device_property_string_array_count(dev, "io-channel-names");
+ if (count < 0)
+ return dev_err_probe(dev, count, "failed to count io-channel-names\n");
+
+ iio_aux = devm_kzalloc(dev, struct_size(iio_aux, chans, count), GFP_KERNEL);
if (!iio_aux)
return -ENOMEM;
iio_aux->dev = dev;
- count = device_property_string_array_count(dev, "io-channel-names");
- if (count < 0)
- return dev_err_probe(dev, count, "failed to count io-channel-names\n");
-
iio_aux->num_chans = count;
- iio_aux->chans = devm_kmalloc_array(dev, iio_aux->num_chans,
- sizeof(*iio_aux->chans), GFP_KERNEL);
- if (!iio_aux->chans)
- return -ENOMEM;
-
names = kcalloc(iio_aux->num_chans, sizeof(*names), GFP_KERNEL);
if (!names)
return -ENOMEM;