Re: [PATCH 2/2] ASoC: spacemit: init *dp to NULL before error paths
"Troy Mitchell" <[email protected]> Sun, 02 Aug 2026 23:38:33 -0700
| Newsgroups | gmane.linux.ports.riscv,gmane.linux.sound,gmane.linux.kernel |
|---|---|
| Message-ID | <[email protected]> |
> However, unlike the Rockchip driver, spacemit_i2s_dai already has most
> of the playback
> and capture capabilities initialized statically. As a result,
> spacemit_i2s_init_dai() ends up
> assigning the same values again, for example channels_min, channels_max,
> rates,
> and formats, which seems redundant.
>
> If you think that makes sense, I can either remove those redundant
> assignments,
> or make it follow the Rockchip approach by keeping the static
> spacemit_i2s_dai
> minimal and initializing those fields only in spacemit_i2s_init_dai().
Nice catch. Please follow the Rockchip approach: keep the static
spacemit_i2s_dai minimal and initialize the playback and capture fields
conditionally in spacemit_i2s_init_dai().
Simply removing the assignments from spacemit_i2s_init_dai() would leave
channels_min nonzero for both directions in the static template.
snd_soc_dai_stream_valid() treats a direction with a nonzero channels_min
as supported, so the driver would continue advertising capture even for
a device with only a "tx" DMA. The binding permits such a configuration.
Please preserve rate_min and rate_max when moving the capability fields,
and send this change as a separate patch.
- Troy
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
signature.asc
(application/pgp-signature, 248 B)
-----BEGIN PGP SIGNATURE----- iIMEABYKACsWIQSL4Ay2cExaPXAQcU2YCe+A+TM0LwUCanA3aQ0caUB0cm95LXku b3JnAAoJEJgJ74D5MzQv1GoA/RVsXEtyqcJ8RIszmDUsvLd9IgXmmHhzlEIWkd7W P8riAQDkDsHlnhNzz31IA1D0iHM2d+mqgfvD61Dyns2CnOZ3Bw== =zb68 -----END PGP SIGNATURE-----